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

1 Answer 1

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() ) {
        $post_query->the_post();
        //stuff
    endwhile;
endif;

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() ) {
        the_post();
        //stuff
    endwhile;
endif;

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

 
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.