Skip to content

Instantly share code, notes, and snippets.

@jymartineau
Created May 12, 2015 16:42
Show Gist options
  • Save jymartineau/725fe2535a463f573695 to your computer and use it in GitHub Desktop.
Save jymartineau/725fe2535a463f573695 to your computer and use it in GitHub Desktop.
Add Custom Post Type Categories to General Categories Archive - Wordpress
//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