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 assuming because I don't have a category template it is defaulting to the archive template, would that affect the outcome.

it seems to output all the posts that have categories: http://www.tigerstudiodesign.com/category/branding/

this is source for archive page: http://pastebin.com/a5jxtBSe

share|improve this question
up vote 0 down vote accepted

this is the problem, starting at line 46:

$args = array(
    'post_type' => 'post'

$post_query = new WP_Query($args);

if($post_query->have_posts() ) {
    while($post_query->have_posts() ) {

you're not using the original query for the page, which contains just posts from the current category, and you're replacing it with a new query that's loading posts of post_type = post, regardless of category.

to use the original query, change your loop to use the default query:

if( have_posts() ) {
    while( have_posts() ) {

note the removal of $post_query-> everywhere. this loop will now use the global $wp_query instead, which contains the posts you want to output.

share|improve this answer
that was it! that was a silly mistake... thanks for pointing that out. I appreciate it. – user766607 Dec 28 '11 at 18:24

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.