// Add merk logo to single product add_action(‘woocommerce_single_product_summary’, ‘toon_merk_logo_op_productpagina’, 5); function toon_merk_logo_op_productpagina() { global $product; $opening_tag = false; // Get SKU $product_number = $product->get_sku(); if ($product_number) { $opening_tag = true; // Let op: Alleen opening tag echo ‘ ‘; echo…Continue reading
// functions.php of via Code Snippets add_filter(‘wp_get_attachment_url’, function ($url, $post_id) { $path = get_attached_file($post_id); if ($path && file_exists($path)) { $url = add_query_arg(‘v’, filemtime($path), $url); } return $url; }, 10, 2);Continue reading
/** * Get X Media – Force RankMath Canada Targeting (Aggressive) * * @package GetXMedia_RankMath_CA * @author Get X Media * @version 2.0.0 */ if ( ! defined( ‘ABSPATH’ ) ) { exit; } /** * Replace RankMath’s en_US locale…Continue reading
function wpcode_current_year() { return date(‘Y’); } add_shortcode(‘current_year’, ‘wpcode_current_year’);Continue reading
// index.php?name=david echo $_GET[‘name’]; // index.php?name=david&surname=adams echo $_GET[‘surname’];Continue reading
/** * WPCode: Highwire meta – Revista Chilena de Anestesiología (robusto + debug) * – Imprime meta tags en de posts. * – No requiere ACF salvo para el repeater de autores (contrib). * – Incluye comentario HTML de debug…Continue reading
// Utilities ———————————————————— function wishlist_is_allowed_path() { $allowed_paths = [‘/rentals’, ‘/collections/’]; $request_uri = $_SERVER[‘REQUEST_URI’] ?? ”; foreach ($allowed_paths as $path) { if (strpos($request_uri, $path) !== false) { return true; } } return false; } // ———————————————————————- // Shortcode: [wishlist_count] —————————————— function…Continue reading
// Utility ———————————————————— function wishlist_is_allowed_path() { $allowed_paths = [‘/rentals’, ‘/collections/’]; $request_uri = $_SERVER[‘REQUEST_URI’] ?? ”; foreach ($allowed_paths as $path) { if (strpos($request_uri, $path) !== false) { return true; } } return false; } // ———————————————————————- // Shortcode: [wishlist_count] —————————————— function…Continue reading
add_filter(‘woocommerce_dropdown_variation_attribute_options_args’, function ($args) { // Make sure we have an attribute slug and (optionally) the product context. $attribute = isset($args[‘attribute’]) ? $args[‘attribute’] : ”; $product = isset($args[‘product’]) && $args[‘product’] instanceof WC_Product ? $args[‘product’] : null; if ($attribute) { // Get…Continue reading