Søgning

WP Query Search Filter
Better Search
Search Exclude
Exclude From Search

// Search filter
function SearchFilter($query) {
    if ($query->is_search) {
    // Insert the specific post type you want to search
        $query->set('post_type','event');
    }
    return $query;
}
    // This filter will jump into the loop and arrange our results before they're returned
add_filter('pre_get_posts','SearchFilter');

Kilde: http://www.hongkiat.com/blog/wordpress-search-plugin-snippet/

Leave a Reply

Your email address will not be published. Required fields are marked *