Created
May 12, 2015 16:42
-
-
Save jymartineau/725fe2535a463f573695 to your computer and use it in GitHub Desktop.
Add Custom Post Type Categories to General Categories Archive - Wordpress
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
//Add Custom Post Type Categories to General Categories Archive | |
function add_custom_types_to_tax( $query ) { | |
if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) { | |
// Get all your post types | |
$post_types = get_post_types(); | |
$query->set( 'post_type', $post_types ); | |
return $query; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment