Support » Fixing WordPress » Archives Displaying Same Posts

  • Resolved myaleigh


    Hi All –

    Can anyone give me an idea on what might be causing my archives page to show the same posts no matter what month you click on? The permalink is correct for example but the posts displayed are the same as the blog’s main page.

    I’m wondering if has to do with how I’m calling the posts in on the main page since I’m excluding certain categories. This is the code I used on the blog’s main page.

    <?php query_posts('cat=-3,-4&posts_per_page=7'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div class="entry">
    <h2><a href="<?php the_permalink() ?>" style="color:#000000;"><?php the_title(); ?></a></h2>
    <p class="date"><?php the_time('l, F jS, Y') ?></p>
    <?php the_content('<p>Read More &raquo;</p>'); ?>
    </div><hr />
    <?php endwhile; else: ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>

    I’m using the default Archives widget to list the archives. I haven’t setup a custom Archives template though so is that possibly the reason?

    Thanks for any clues/help you can give.

Viewing 1 replies (of 1 total)
  • esmi


    Forum Moderator

    Try changing:

    <?php query_posts('cat=-3,-4&posts_per_page=7'); ?>


    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('cat=-3,-4&posts_per_page=7&paged='.$paged); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Archives Displaying Same Posts’ is closed to new replies.