Return to Snippet

Revision: 44848
at April 19, 2011 22:09 by zealmurapa


Initial Code
// Search Post only not Pages
function vibeExcludePages($query) {
        if ($query->is_search) {
        $query->set('post_type', 'post');
                                }
        return $query;
}
add_filter('pre_get_posts','vibeExcludePages');
; ?>

Initial URL

                                

Initial Description

                                

Initial Title
Search Posts Only

Initial Tags
search

Initial Language
PHP