Created
August 30, 2012 19:11
-
-
Save pippinsplugins/3538015 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 pw_remove_downloads_from_search( $query ) { | |
| if( $query->is_search() && $query->is_main_query() ) { | |
| $query->set('post_type', array( 'page', 'post'' ) ); // add any other post types you want to include | |
| } | |
| } | |
| add_action( 'pre_get_posts', 'pw_remove_downloads_from_search' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment