Forums

Ajaxy Live Search
Hide specific page results from Live Search (1 post)

  1. rwbennet
    Member
    Posted 7 months ago #

    I just want to hide specific pages by ID or Page Name from the live search. I can do it fine on the search results page using something like the following in my functions.php:

    //------------------------Exclude Pages From Search
    function SearchFilter($query) {
        if ($query->is_search) {
    
            $exclude = '1348,1346';
            $query->set('post__not_in', explode(",", $exclude));
        }
        return $query;
    }
    
    add_filter('pre_get_posts','SearchFilter');

    But it doesn't look like ajaxy is using the WP search queries for it's live search. Any suggestions for hooks into the plugin or anything WITHOUT manually adjusting the plugin itself?

    http://wordpress.org/extend/plugins/ajaxy-search-form/

Reply

You must log in to post.

About this Plugin

About this Topic