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 using this Query to pull in the latest 3 post

$query = 'posts_per_page=3';
$queryObject = new WP_Query($query);
// The Loop...
if ($queryObject->have_posts()) {
while ($queryObject->have_posts()) {

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
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

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.