Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am running query_post with the following arguments,

<?php $args = array(
'category'        => $cat,
'orderby'         => 'post_date',
'order'           => 'DESC',
'post_type'       => 'blog',
'post_status'     => 'publish' ); 


$cat = 7 in this instance, it should be returning 1 posts, but it is returning all my posts if they are in any category.

share|improve this question
check the docu for category query parameters:… – Michael Aug 30 '11 at 12:21

1 Answer 1

up vote 1 down vote accepted
       // Category should be 'cat'
 $args = array( 'cat' => $cat, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'blog', 'post_status' => 'publish' );

share|improve this answer

Your Answer


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.