Skip to content

Instantly share code, notes, and snippets.

View gicolek's full-sized avatar

Rafał Gicgier - Certified Codeable Expert Developer gicolek

View GitHub Profile
@gicolek
gicolek / contact_form_7_updates.css
Last active April 24, 2024 11:54
Contact Form 7 updated CSS
/* this part of the code adds two columns to desktop */
@media only screen and (min-width: 767px) {
.c-custom-contact-form-7 .c-grid {
display: grid;
gap: 5px;
grid-template-columns: 50% 50%;
}
}
/* this part of the code adds two columns to desktop */
@gicolek
gicolek / contact_form_7_layout.html
Last active April 24, 2024 11:55
Contact Form 7 layout
<div class="c-custom-contact-form-7">
<div class="c-grid">
<label> Your name
[text* your-name] </label>
<label> Your email
[email* your-email] </label>
</div>
<div>
@gicolek
gicolek / gf_api_entries_4.php
Created February 27, 2024 22:58
Gravity Forms API Table Marup
<?php
// Assuming $entry is already defined as in your previous code
echo '<table border="1">';
echo '<tr>';
echo '<th>ID</th>';
echo '<th>Date Created</th>';
echo '<th>Testing Field</th>';
echo '<th>Second Choice</th>';
// Add more <th> elements for additional fields as needed
@gicolek
gicolek / gf_api_entries_3.php
Created February 27, 2024 22:53
Customize GFAPI Entries
<?php
foreach ($entry as $entry_data) {
if ($entry_data[3.1] === 'First Choice') {
echo '<p>This entry has the first choice selected:</p>';
// Additional code for displaying other fields or custom formatting
}
}
@gicolek
gicolek / gf_api_entries_2.php
Created February 27, 2024 22:52
Gravity Forms entries
<?php
foreach ( $entry as $entry_data ) {
echo '<p>Testing Field: ' . $entry_data[1] . '</p>';
echo '<p>Second Choice: ' . $entry_data[2] . '</p>';
}
@gicolek
gicolek / gf_api_get_entries.php
Created February 27, 2024 22:51
GF API get entries
<?php
$form_id = '1';
$entry = GFAPI::get_entries( $form_id );
?>
@gicolek
gicolek / contact-form-two-col-layout.html
Created February 22, 2024 15:44
Contact Form 7 Two Column Layout
<div class="c-grid">
<div>
<label> Your name
[text* your-name] </label>
<label> Your email
[email* your-email] </label>
</div>
<div>
@gicolek
gicolek / grid.css
Created February 22, 2024 15:38
A sample grid two column layout
.c-grid {
display: grid;
grid-template-columns: auto auto;
gap: 20px;
}
@gicolek
gicolek / resend_woocommerce_order_id.php
Created February 22, 2024 12:56
Resend WooCommerce order_id, a useful snippet
<?php
/**
* Trigger WooCommerce order email programatically.
*
* @param INT order_id - WooCommerce WC_Order order id
*/
function prefix_send_woocommerce_order_emails( $order_id ) {
$wc_emails = WC()->mailer()->get_emails();
if ( empty( $wc_emails ) ) return;
@gicolek
gicolek / gra2.js
Created December 2, 2023 20:17
Gra 2 JS
document.addEventListener("DOMContentLoaded", function () {
const player = document.getElementById("bunny");
const container = document.getElementById("container");
const gameArea = document.getElementById("container");
const bgground = document.getElementById('bg-ground');
let isJumping = false;
let jumpHeight = 300; // Adjust the jump height as needed
let jumpSpeed = 10; // Adjust the jump speed as needed