• hi there

    I Need to EXCLUDE some Categories from the search result… i have added the following code to the functions.php file but it doesnt seem to exclude the categories for the WP-custom-search:

    function SearchFilter($query) {
    if ($query->is_search) {
    $query->set(‘cat’,’1,17,6′);
    }
    return $query;
    }
    add_filter(‘pre_get_posts’,’SearchFilter’);

    There must be an easy way to do this.

    Love the plugin by the way… if anyone can help me figure this out it will be perfect!

    Mandy

    https://www.ads-software.com/extend/plugins/wp-custom-fields-search/

  • The topic ‘[Plugin: WP Custom Fields Search] Exclude some categories from Custom search result’ is closed to new replies.