WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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: codex.wordpress.org/Class_Reference/… – Michael Aug 30 '11 at 12:21
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.