Wordpress: Retriving posts of a specific custom category in a custom taxonomy

Posted by Extrakun on Stack Overflow See other posts from Stack Overflow or by Extrakun
Published on 2010-05-13T10:11:19Z Indexed on 2010/05/13 10:14 UTC
Read the original article Hit count: 275

Filed under:

I am able to retrieve all the posts from a custom category with this call to WP_Query

$q = new WP_Query(array( 'taxonomy' => 'jh-portfolio-category',
                          'term' => 0, 'post_type' => 'jh-portfolio' ));

However, let say within the jh-portfolio-category taxonomy I have defined some sub-categories, how do I specify I wish to have posts from a specific sub-category? Changing the 'term' property to the term_id as presented in wp_term_taxonomy doesn't seem to work.

© Stack Overflow or respective owner

Related posts about Wordpress