Support

Account

Home Forums General Issues Pre_get_posts loop Reply To: Pre_get_posts loop

  • try adding a check to see if it is then main query

    
    function wpb_search_filter( $query ) {
    
       if(!is_admin() && is_search() && $query->is_main_query()){
    
        //..... code continues