View include-post-types-in-search.php
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
<?php | |
add_action( 'pre_get_posts', 'prefix_include_cpts_in_search' ); | |
/** | |
* Include custom post types in search results. | |
* | |
* Custom post types are not included in the default WordPress search | |
* functionality. This code will add them to all front-end searches. | |
* | |
* @author FAT Media, LLC | |
* @link http://youneedfat.com |