Last active
December 31, 2015 18:39
-
-
Save rickalee/8028035 to your computer and use it in GitHub Desktop.
Search Equipment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function search_filter($query) { | |
if ( !is_admin() && $query->is_main_query() ) { | |
if ($query->is_search) { | |
$query->set( 'post_type', array( 'listing' ) ); | |
$query->set( 'posts_per_page', -1 ); | |
} | |
} | |
} | |
add_action('pre_get_posts','search_filter'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment