Created
January 16, 2015 05:56
-
-
Save raewrites/816f6c4b1a068a3d61df to your computer and use it in GitHub Desktop.
Get Post
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 | |
function my_function() { | |
if ( is_home() && $query->is_main_query() ) { | |
$query->set( 'post_type', array( 'post', 'custom_post_type') ); | |
return $query; | |
} | |
} | |
add_action( 'pre_get_posts', 'my_function'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment