// Search Exclude Page / Kiri Vadivelu / 2026 add_action(‘pre_get_posts’, ‘exclude_pages_search’); function exclude_pages_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_tags_from_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 Query / Kiri Vadivelu / 2026 function filter_search_by_multiple_categories( $query ) { // Only modify the main query on the front-end search results page if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) { // Check if category_name…Continue reading
Loading the Elevenlabs Text to Speech AudioNative Player…Continue reading
add_filter( ‘post_thumbnail_html’, ‘my_default_featured_image’, 10, 5 ); function my_default_featured_image( $html, $post_id, $post_thumbnail_id, $size, $attr ) { // If no HTML is generated (no featured image set) if ( empty( $html ) ) { // Replace with your actual image URL $default_image_url…Continue reading