Filtering custom taxonomies

This is not a tought quest, but you’d have to read carefully the Codex. Especially tax_query part of WP_Query.

Your proposed query_posts call is wrong. This should look like this:

query_posts( array(  
    'post_type' => 'myportfoliotype', 
    'paged' => $paged, 
    'posts_per_page' => 80, 
    'tax_query' => array( 
        array( 
            'taxonomy' => 'category', //or tag or custom taxonomy
            'field' => 'id', 
            'terms' => array('9') 
        ) 
    ) 
) );

Further, to gain more efficiency of using DB queries, you should consider using pre_get_posts hook instead of query_posts

Leave a Comment