Untitled Snippet
add_action(‘template_redirect’, function () { if (! is_front_page()) { return; } echoContinue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_action(‘template_redirect’, function () { if (! is_front_page()) { return; } echoContinue reading
// Stap 1: Verwijder de standaard related products remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_related_products’, 20 ); // Stap 2: Toon cross-sells aangevuld met related products tot totaal van 4 add_action( ‘woocommerce_after_single_product_summary’, function() { global $product; if ( ! $product || ! is_a( $product,…Continue reading
// get_mb_relationships_dat // Pour l’appeler dans le code : // —— // Exemple 1 // En haut de fichier // {% set prefectures_liees = mb.get_mb_relationships_data(post.ID, ‘tsunami_to_prefectures’, ‘prefecture’, ‘from’, [‘code_pref’, ‘population’]) %} // Puis, pour l’affichage // {% set pref_textes =…Continue reading
add_action( ‘admin_init’, ‘autoriser_admin_sur_les_traductions’ ); function autoriser_admin_sur_les_traductions() { // Sécurité : on vérifie que la fonction existe et que l’utilisateur est admin if ( ! function_exists( ‘get_role’ ) || ! current_user_can( ‘administrator’ ) ) { return; } $role = get_role( ‘administrator’…Continue reading
// === TECNOFOTO – COMPROBACIÓN DATOS ORLA + EDICIÓN + POPUP + INCIDENCIAS === // Página /comprobacion-de-datos con shortcode: [comprobacion_datos_orla] if (!defined(‘ABSPATH’)) exit; /* ========================================================= * 0) Proteger página /comprobacion-de-datos solo para logueados * ======================================================= */ add_action(‘template_redirect’, function () {…Continue reading
add_action(‘woocommerce_before_single_product’, function () { global $post; if (!is_product()) return; $product = wc_get_product($post->ID); if (!$product) return; $tags = wp_get_post_terms($post->ID, ‘product_tag’, [‘fields’ => ‘names’]); $tag_string = !empty($tags) ? esc_attr(implode(‘, ‘, $tags)) : ”; echo ‘Continue reading
add_shortcode(‘product_features_boxes’, function () { if (!function_exists(‘wc_get_product’)) { return ”; } global $product; if (!$product || !is_a($product, ‘WC_Product’)) { $product = wc_get_product(get_the_ID()); } if (!$product) { return ”; } $attributes = $product->get_attributes(); if (empty($attributes)) { return ”; } $items = array();…Continue reading
/** * EA Elementor Hooks Fallback * * Prevents Essential Addons frontend scripts from breaking custom JS * when they reference window.elementor.hooks before Elementor has fully * initialized. * * Required for: * – Hero card scroll behavior * –…Continue reading
/** * Notification Panel Content Loader * * Loads the Elementor template with the slug: * notification-container * * This template contains the Notification Listing Grid and * is injected into a hidden container for the global * notification panel.…Continue reading