Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 = array( 'nav_menu_item','your_custom_type');
- $query->set( 'post_type', $post_types );
- return $query;
- }
- }
- add_filter( 'pre_get_posts', 'add_custom_types_to_tax' );
Advertisement
Add Comment
Please, Sign In to add comment