Example:
PHP
// MAKE CUSTOM POST TYPES SEARCHABLE
function searchAll( $query ) {
if ( $query->is_search ) { $query->set( 'post_type', array( 'site', 'plugin', 'theme', 'person' )); }
return $query;
}
add_filter( 'the_search_query', 'searchAll' );
Code of Include custom post types in the search results | Wordpress Search Shortcode |
Add your custom post types to your sites main RSS feed by default | Wordpress Search Shortcode |
This will include your custom post types and the post counts for each type in the "Right Now" dashboard widget | Wordpress Search Shortcode |
How to Include custom post types in the search results | Wordpress Search Shortcode |
Type: | Php |
Category: | Web Tutorial |
Sub Category: | Wordpress Search Shortcode |
Uploaded by: | Admin |