Missing /Stories SLUG

add_action(‘template_redirect’, function () { if (is_admin()) return; global $wp; $request_path = trim($wp->request, ‘/’); // Skip if already under /stories/ if (strpos($request_path, ‘stories/’) === 0) return; // Only run on 404s (old URLs) if (is_404()) { // Extract slug (last part…Continue reading

Guard Pay Diagnostic Tool

/** * ============================================================ * GUARDEDPAY PRO — Phase 1 Diagnostic (TEMPORARY) * ============================================================ * * PURPOSE: Detects child theme status and scans checkout output * for deprecated GuardedPay copy that needs removal. * * INSTALL: Add via Code Snippets plugin…Continue reading

Disable Legacy CSS

add_filter( ‘show_recent_comments_widget_style’, ‘__return_false’ ); add_filter( ‘use_default_gallery_style’, ‘__return_false’ );Continue reading

Limit Comments & Display Character Count

if ( ! class_exists( ‘WPCode_Comment_Limit_Counter’ ) ) { class WPCode_Comment_Limit_Counter { // Update this value to change the maximum number of characters allowed in a comment. protected $comment_max_length = 100000; // Update this value to change the minimum number of…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

Disable jQuery Migrate

//Remove jQuery migrate function smartwp_remove_jquery_migrate( $scripts ) { if ( !is_admin() && !empty( $scripts->registered[‘jquery’] ) ) { $scripts->registered[‘jquery’]->deps = array_diff( $scripts->registered[‘jquery’]->deps, [‘jquery-migrate’] ); } } add_action(‘wp_default_scripts’, ‘smartwp_remove_jquery_migrate’);Continue reading