// 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 / 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 / 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 / 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 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
/** * 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
add_action( ‘wp_enqueue_scripts’, function() { if ( ! class_exists( ‘FrmRegGlobalSettings’ ) || ! class_exists( ‘FrmProAppController’ ) ) { return; } $global_settings = new FrmRegGlobalSettings(); $reset_page_id = (int) $global_settings->get_global_page( ‘resetpass_page’ ); if ( ! $reset_page_id || ! is_page( $reset_page_id ) ) {…Continue reading
remove_action( ‘wp_footer’, ‘wpcomsh_footer_rum_js’ ); // remove frontend // remove_action( ‘admin_footer’, ‘wpcomsh_footer_rum_js’ ); // remove backendContinue reading
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