Search Exclude Page

// Search Exclude Page / Kiri Vadivelu / 2026 add_action(‘pre_get_posts’, ‘exclude_page_search’); function exclude_page_search($query) { if (!is_admin() && $query->is_main_query() && $query->is_search) { $query->set(‘post_type’, ‘post’); } }Continue reading

Search Exclude Tag

// Search Exclude Tag / Kiri Vadivelu / 2026 function exclude_tag_search( $query ) { if ( $query->is_search && ! is_admin() ) { $query->set( ‘tag__not_in’, array( 8, 9 ) ); // Replace with your tag IDs } return $query; } add_filter(…Continue reading

Search Exclude Category

// Search Exclude Category / Kiri Vadivelu / 2026 function exclude_categories_from_search( $query ) { if ( ! is_admin() && $query->is_search && $query->is_main_query() ) { // Replace with your negative category IDs $query->set( ‘cat’, ‘-1,-2’ ); } } add_action( ‘pre_get_posts’, ‘exclude_categories_from_search’…Continue reading

Advanced Search Filter

// Advanced Search Filter / Kiri Vadivelu / 2026 function advanced_search_filter( $query ) { // Only modify the main query on the front-end search results if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) { // Check if category_name is…Continue reading

Popup inventario

/** * Popup temporaneo – Avviso sospensione spedizioni * WPCode – PHP Snippet */ add_action(‘wp_footer’, function () { // Data oltre la quale il popup non viene più mostrato. // Formato: YYYY-MM-DD $scadenza = ‘2026-10-05’; if (current_time(‘Y-m-d’) > $scadenza) {…Continue reading

TEMP Sideload Guard — remove when pg-display ships (BACKLOG #45)

/** * PG Sideload Guard — TEMPORARY. Installed 2026-09-15. * * ══════════════════════════════════════════════════════════════════════ * THIS IS A TOURNIQUET. IT IS MEANT TO BE DEACTIVATED. * ══════════════════════════════════════════════════════════════════════ * * WHAT IT DOES: blocks front-end HTTP requests for image files. Nothing else. *…Continue reading

Remove Optional Script

remove_action( ‘wp_footer’, ‘wpcomsh_footer_rum_js’ ); // remove frontend // remove_action( ‘admin_footer’, ‘wpcomsh_footer_rum_js’ ); // remove backendContinue reading

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