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


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.

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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