Single product – Custom label

/** * ACF-productlabel tonen. */ function ld_product_label() { if (!function_exists(‘get_field’)) { return; } global $product; if (!$product instanceof WC_Product) { return; } $label_text = get_field(‘label_tekst’, $product->get_id()); $kleur = get_field(‘achtergrondkleur’, $product->get_id()); if (!$label_text) { return; } if (!$kleur) { $kleur =…Continue reading

Vakantiebanner nieuw

/* ========================================================= Vakantie-popup met instellingenpagina — WPCode PHP snippet – Menu-item “Vakantie popup” in het WordPress-menu – Sitenaam wordt automatisch uit de websitetitel gehaald – Start- en einddatum, teksten en icoon instelbaar – Testknop toont de popup direct in het…Continue reading

Hide Calendar Event Pages From Being Indexed

add_action(‘template_redirect’, function() { if (!empty($_GET[‘mc_id’]) || is_singular(‘mc-events’)) { header(‘Location: ‘ . home_url(‘/upcomingevents/’), true, 301); exit; } }); add_action(‘init’, function() { global $wp_post_types; if (isset($wp_post_types[‘mc-events’])) { $wp_post_types[‘mc-events’]->public = false; $wp_post_types[‘mc-events’]->publicly_queryable = false; $wp_post_types[‘mc-events’]->exclude_from_search = true; } }, 99);Continue reading

CSS Class for matching religion to a color – Copy

$rlgn = get_field(‘Rlgn’); // Get the ACF field value if (!$rlgn) return; // Define the color mapping $colors = [ ‘Ethnoreligion’ => ‘#590cc6’, ‘Buddhism’ => ‘#c61836’, ‘Hinduism’ => ‘#d87716’, ‘Judaism’ => ‘#ede71d’, ‘Islam’ => ‘#0b7034’, ‘Shinto’ => ‘#6d0c23’, ‘Sikh’ =>…Continue reading