Limit Search to Product Pages only unless I’m on Blogpage or Blogposts
I don’t fully understand, but: function lw_search_filter_pages ( $query ) { // … } if ( is_front_page () || is_home () ) {} else { add_filter ( ‘pre_get_posts’, ‘lw_search_filter_pages’ ); } Another: function lw_search_filter_pages ( $query ) { // … } // https://yoursite.tld/blog $uri = $_SERVER [ ‘REQUEST_URI’ ]; // $uri = ‘/blog’; if ( … Read more