Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have registered custom post type Article in my template using register_post_type function. and i also having taxonomy category for this article posts.

Here i want to filter the posts under particular category. using query post

How can i do this

Thanks in advance !

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

If you read http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters in detail it outlines everything you need. Take a look at the following code sample taken from the codex. It should help you :)

$args = array(
    'post_type' => 'Article', /* This is where you should put your Post Type */
    'tax_query' => array(
        array(
            'taxonomy' => 'people',
            'field' => 'slug',
            'terms' => 'bob'
        )
    )
);
$query = new WP_Query( $args );

Please note that this query does NOT account for paginated data.

share|improve this answer
    
Thanks that works really great ! –  gowri Jul 18 '11 at 13:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.