Elementor LCP Image Preloader (copy)

/** * Elementor LCP Background Image Preloader v2.1 * * Extracts the EXACT URL from Elementor’s _elementor_data JSON * This ensures the preloaded URL matches what Elementor’s CSS requests * * WPCODE SETUP: * – Code Type: PHP Snippet *…Continue reading

Elementor LCP Image Preloader (copy)

/** * Elementor LCP Background Image Preloader v2.1 * * Extracts the EXACT URL from Elementor’s _elementor_data JSON * This ensures the preloaded URL matches what Elementor’s CSS requests * * WPCODE SETUP: * – Code Type: PHP Snippet *…Continue reading

FC – Ayuda con debug

add_action(‘doing_it_wrong_run’, function($function, $message, $version) { if ($function !== ‘_load_textdomain_just_in_time’) return; if (strpos($message, ‘dominio acf‘) === false && strpos($message, ‘domain acf‘) === false) return; $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); // Recorta un poco para que sea legible $lines = []; foreach (array_slice($bt, 0,…Continue reading

Rimozione tab review/recensioni da PDP

// 1) Rimuove completamente l’area tabs add_action(‘wp’, function () { remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_product_data_tabs’, 10 ); }); // 2) Stampa la descrizione lunga al posto dei tabs add_action( ‘woocommerce_after_single_product_summary’, function () { global $post; if ( ! empty( $post->post_content ) )…Continue reading

Untitled Snippet

/** * Hero Section – Portfolio Homepage * Shortcode: [lihay_hero] */ function lihay_hero_section() { ob_start(); ?> ✨ מוח יצירתי בעבודה אני עושה מותגים בלתי אפשרי להתעלם. אסטרטגיה. תוכן. מערכות. אוטומציה. הכל מחובר. הכל כוונה. התחל פרויקט → ראה את העבודות…Continue reading

Search Display

function custom_enqueue_scripts() { wp_add_inline_script( ‘jquery’, // Cargar después de jQuery ” document.addEventListener(‘DOMContentLoaded’, function () { const toggleIcon = document.getElementById(‘show-search-icon’); const searchForm = document.getElementById(‘search-form-container’); if (toggleIcon && searchForm) { toggleIcon.addEventListener(‘click’, function () { if (searchForm.style.display === ‘none’ || searchForm.style.display === ”)…Continue reading

Use the real IP address for customers when creating an order

add_action(‘woocommerce_checkout_update_order_meta’, ‘set_real_customer_ip’, 10, 2); function set_real_customer_ip($order_id, $data) { // Check if Cloudflare provides the real IP address in the HTTP_CF_CONNECTING_IP header if (isset($_SERVER[‘HTTP_CF_CONNECTING_IP’])) { $real_ip = sanitize_text_field($_SERVER[‘HTTP_CF_CONNECTING_IP’]); } elseif (isset($_SERVER[‘HTTP_X_FORWARDED_FOR’])) { // Fallback to another common proxy header $real_ip =…Continue reading