0

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.

1

1 Answer 1

1
       // Category should be 'cat'
    <?php
 $args = array( 'cat' => $cat, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'blog', 'post_status' => 'publish' );

        ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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