Return to Snippet

Revision: 50690
at August 30, 2011 17:35 by IronMANro


Initial Code
add_filter('pre_get_posts', 'query_post_type');
function query_post_type($query) {
  if(is_category() || is_tag() || is_home() && empty( $query->query_vars['suppress_filters'] ) ) {
    $post_type = get_query_var('post_type');
	if($post_type)
	    $post_type = $post_type;
	else
	    $post_type = array('post','articles','nav_menu_item');
    $query->set('post_type',$post_type);
	return $query;
    }
}

Initial URL
http://wordpress.org/support/topic/custom-post-type-tagscategories-archive-page/page/2

Initial Description

                                

Initial Title
Custom post type tags/categories archive page

Initial Tags
wordpress

Initial Language
PHP