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
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
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
add_filter( ‘pre_do_shortcode_tag’, static function ( $output, $tag, $atts ) { if ( ‘frm-reset-password’ !== $tag || ! is_user_logged_in() || ! isset( $_GET[‘key’], $_GET[‘login’] ) || ! class_exists( ‘FrmRegResetPWForm’ ) ) { return $output; } $key = sanitize_text_field( wp_unslash( $_GET[‘key’] )…Continue reading
/* * 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
add_action(‘wp_body_open’, function() { echo ‘ ‘; }); add_action(‘wp_head’, function() { echo ‘ ‘; }); add_action(‘wp_footer’, function() { echo ‘‘; });Continue reading
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
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
/* * Snippet #102 (ID 37769): People Group Profile page — LTL Banner display * * Shortcode: [ltl_banner] * Place on the People Group profile page template where the banner should appear. * * Behaviour: * – Reads the current…Continue reading
/** * Snippet Title: PG Profile — Dig Deeper slider outside label fix * Description: Fixes unreadable percentage labels in the UAGB Counter Bars blocks * in the Religion and Language Dig Deeper sections on PG profile pages. * *…Continue reading
add_action( ‘template_redirect’, ‘rd_disable_lazyload_for_marked_theme_background_images’, 1 ); function rd_disable_lazyload_for_marked_theme_background_images() { if ( is_admin() || wp_doing_ajax() || wp_is_json_request() ) { return; } if ( defined( ‘REST_REQUEST’ ) && REST_REQUEST ) { return; } if ( is_feed() || is_trackback() || is_robots() || is_embed() )…Continue reading
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