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 twentyten theme. I am trying to exclude category 1 from author posts. I used the following code in loop.php

while ( have_posts() ) : the_post(); ?>

But no post is displaying. How to fix this?

share|improve this question
up vote 1 down vote accepted

You've misplaced the apostrophe.

query_posts('cat=-1'); while ( have_posts() ) : the_post(); ?>
share|improve this answer
Thanks. Now the posts are displaying but all authors posts are displaying. – designersvsoft Aug 16 '12 at 12:43
Yes, that is correct. Do you want to exclude some authors as well? Or show posts from only one author? – pbd Aug 16 '12 at 13:13
If i click author A then the posts posted by him only display. Other authors posts should not display in author A's page. – designersvsoft Aug 17 '12 at 4:47
Add the author parameter to your query, like this: query_posts('cat=-1&author=3'), where 3 is the author id. – pbd Aug 17 '12 at 6:28
Thanks a lot. It's working. – designersvsoft Aug 17 '12 at 6:59

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.