Guest User

Untitled

a guest
Dec 5th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. function add_custom_types_to_tax( $query ) {
  2. if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
  3.  
  4. // Get all your post types
  5. $post_types = array( 'nav_menu_item','your_custom_type');
  6.  
  7. $query->set( 'post_type', $post_types );
  8. return $query;
  9. }
  10. }
  11.  
  12. add_filter( 'pre_get_posts', 'add_custom_types_to_tax' );
Advertisement
Add Comment
Please, Sign In to add comment