Created
March 9, 2012 17:49
-
-
Save jo-snips/2007736 to your computer and use it in GitHub Desktop.
Wordpress: Include Post Types in Search
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
// Define what post types to include in search | |
function include_in_search( $query ) { | |
if ( $query->is_search ) { | |
$query->set( 'post_type', array( 'post', 'page', 'feed', 'tribe_events' )); | |
} | |
return $query; | |
} | |
add_filter( 'the_search_query', 'include_in_search' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment