Created
March 16, 2015 18:42
-
-
Save webgurus/2313afc0ca1e499d4488 to your computer and use it in GitHub Desktop.
Include custom post types in all WordPress loops
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
function custom_post_type_in_home_loop( $query ) { | |
if ( is_home() && $query->is_main_query() ) | |
$query->set( 'post_type', array( 'post', 'travel','deals','food_cooking') ); | |
return $query; | |
} | |
add_filter( 'pre_get_posts', 'custom_post_type_in_home_loop' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment