Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter drophit

    (@drophit)

    Ok so i found your sample filters ?? Just not sure why they wont work when placed in my functions file? Any specific place these should live?

    Thread Starter drophit

    (@drophit)

    OK so i did a little hacking and this works well – obviously can be expanded:

    Add this to class-daves-wordpress-live-search-results.php line 163:

    apply_filters( 'dwls_alter_search', $query, -1 );

    Then add this to your functions.php:

    //update for daves search to add a cat filter
    function search_only_cat($query)
    {
     $query->set('cat', '2');//this can be numerous cats ie. 2,3,4
    }
    add_action('dwls_alter_search', 'search_only_cat');

    See it in action here https://emailtheboss.org

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Update to show results by catefory?’ is closed to new replies.