Open your theme’s functions.php file and add the below code or you can also add the below code inside your site-specific plugin.
1 2 3 4 5 6 7 8 9 | /** * Add custom post types to the default RSS feed. */ function custom_feed_request( $vars ) { if (isset($vars['feed']) && !isset($vars['post_type'])) $vars['post_type'] = array( 'post', 'site', 'plugin', 'theme', 'person' ); return $vars; } add_filter( 'request', 'custom_feed_request' ); |
1 2 3 4 5 6 7 8 | /** * Add custom post types in the search results. */ function searchAll( $query ) { if ( $query->is_search ) { $query->set( 'post_type', array( 'site', 'plugin', 'theme', 'person' )); } return $query; } add_filter( 'the_search_query', 'searchAll' ); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.