Set Banner BG Color

add_action( ‘wp_head’, function() { if ( is_singular() ) { $banner_color = get_post_meta( get_the_ID(), ‘banner_color’, true ); if ( $banner_color ) { echo ‘ ‘; } } });Continue reading

GTranslate language switch – PROD LIBRARY

/* * Snippet #113: GTranslate language switch — auto reload * * GTranslate with url_structure=none sets the googtrans cookie client-side but * does not trigger a page reload. This means PHP-rendered content (e.g. the LTL * banner PDF link) and…Continue reading

Scroll Progress Bar

add_action(‘wp_body_open’, function() { echo ‘ ‘; }); add_action(‘wp_head’, function() { echo ‘ ‘; }); add_action(‘wp_footer’, function() { echo ‘‘; });Continue reading

[Hunters Hill Trust] House Count Dynamic Data Shortcode

function rd_greenbook_house_count_shortcode() { $counts = wp_count_posts( ‘wpsl_stores’ ); return isset( $counts->publish ) ? esc_html( number_format_i18n( (int) $counts->publish ) ) : ‘0’; } add_shortcode( ‘rd_greenbook_house_count’, ‘rd_greenbook_house_count_shortcode’ );Continue reading

Next and Previous MLL Post

add_filter( ‘etch/dynamic_data/post’, function( $data, $post_id ) { $prev = get_previous_post(); $next = get_next_post(); $image_size = ‘medium’; $data[‘prev_post’] = $prev ? [ ‘title’ => html_entity_decode( get_the_title( $prev ), ENT_QUOTES, ‘UTF-8’ ), ‘permalink’ => get_permalink( $prev ), ‘thumbnail’ => get_the_post_thumbnail_url( $prev->ID, $image_size…Continue reading

[Papa Macros] Rename Default WooCommerce ‘Description’ Tab to ‘Ingredients’

add_filter( ‘woocommerce_product_description_heading’, ‘custom_change_description_heading_for_specific_categories’ ); function custom_change_description_heading_for_specific_categories( $heading ) { global $product; if ( ! is_product() || ! $product instanceof WC_Product ) { return $heading; } // Check if product has either ‘meals’ or ‘snacks’ category if ( has_term( [ ‘meals’,…Continue reading