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 !

link|improve this question

feedback

1 Answer

up vote 2 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.

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

Your Answer

 
or
required, but never shown

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