WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. rwbennet
    Member
    Posted 1 year 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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic