0

I am using this Query to pull in the latest 3 post

<?php
$query = 'posts_per_page=3';
$queryObject = new WP_Query($query);
// The Loop...
if ($queryObject->have_posts()) {
while ($queryObject->have_posts()) {
    $queryObject->the_post();
    the_title();
    the_content();
            comments_template();
}
}
wp_reset_postdata();
?> 

I need to add from category 1

I tried adding

query_posts($query_string . '&cat=-3');

at the top of the query, it works but the formatting is not the same and the comment box is missing.

I am using this query in a tabbing plugin and is the only query that pulls in the comment box that works in a tabbing plugin that I have found, so I am trying to get this particular query to work

Thanks for any help

1

1 Answer 1

1

Did you try

$query = 'posts_per_page=3&cat=3';

?

0

Your Answer

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

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