Previous Entries same as Home Page
-
Hi, I have a problem with Previous Entries (/page/2/) displaying the same entries as those on my Home Page.
I think the problem comes from the Loop. Here is my code if that can help:
<?php get_header(); ?> <?php get_sidebar(); ?> <?php $posts = get_posts('numberposts=5'); foreach ($posts as $post) : ?> <a href="<?php the_permalink(); ?>" title="<?php the_title() ?>"><?php the_title() ?></a></li><br /> <?php the_category(', ') ?> <?php endforeach; ?> <br /> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a><br /> <?php the_time('F jS, Y') ?> | Posted in <?php the_category(', ') ?><br /> <?php comments_popup_link('Leave a comment »', '1 comment »', '% comments »'); ?> <?php the_content('Read the rest of this entry »'); ?> <?php endwhile; ?> <div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries »') ?></div> <?php else : ?> <h2>Not Found</h2> Sorry, but you are looking for something that isn't here. <?php include (TEMPLATEPATH . "/searchform.php"); ?> <?php endif; ?> <?php get_footer(); ?>
Thanks a lot for your help!
- The topic ‘Previous Entries same as Home Page’ is closed to new replies.