Created
January 16, 2015 05:58
-
-
Save raewrites/a90b6d0c6f79abce6940 to your computer and use it in GitHub Desktop.
Amend Category Archives
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_category() && $query->is_main_query() ) { | |
$query->set( 'post_type', '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