Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
    
there is information in the WordPress Codex; for instance codex.wordpress.org/Class_Reference/WP_Query#Usage and codex.wordpress.org/Function_Reference/query_posts –  Michael Mar 16 '12 at 16:54
add comment

1 Answer

up vote 1 down vote accepted

Did you try

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

?

share|improve this answer
    
That worked, Thank you –  Tim Mar 16 '12 at 17:03
add comment

Your Answer

 
discard

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.