First post appearing on multiple pages
-
I have added page numbers to the bottom of my main blog page as I anticipate the number of entries getting much longer. It looks good however when the viewer clicks on Page 2 the most recent post appears there again with the older posts following it.
my blog can be found at https://www.donmamonephotography.com/blog
I am using the Chaotic Soul theme and it is definitely specific to this theme because it does not do this if I switch to another theme.
Any advise would be much appreciated.
D-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Index.php code is:
<?php get_header(); ?>
<div id=”content” class=”narrowcolumn”>
<?php if (have_posts()) : ?>
<!– First Post –>
<?php $top_query = new WP_Query(‘showposts=1’); ?>
<?php while($top_query->have_posts()) : $top_query->the_post(); $first_post = $post->ID; ?><div class=”post top” id=”post-<?php the_ID(); ?>”>
<h2 class=”first”>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></h2>
<span class=”postmetadata”>• <?php comments_popup_link(‘No Comments’, ‘1 Comment’, ‘% Comments’); ?> <?php edit_post_link(‘Edit’, ‘(‘, ‘)’); ?></span><div class=”entry”>
<?php the_content(“<span class=\”continue\”>” . __(‘Continue reading’,”) . ” ‘” . the_title(”, ”, false) . “‘</span>”); ?>
</div>
</div><?php endwhile; ?>
<!– Next few posts –>
<?php while(have_posts()) : the_post(); if(!($first_post == $post->ID)) : ?><div class=”post lastfive” id=”post-<?php the_ID(); ?>”>
<h2>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></h2>
<span class=”postmetadata”>• <?php comments_popup_link(‘No Comments’, ‘1 Comment’, ‘% Comments’); ?> <?php edit_post_link(‘Edit’, ‘(‘, ‘)’); ?></span><div class=”entry”>
<?php the_content(); ?>
</div>
</div><?php endif; endwhile; ?>
<?php else : ?>
<h2 class=”center”>Not Found</h2>
<p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
<?php include (TEMPLATEPATH . “/searchform.php”); ?><?php endif; ?>
<?php if(function_exists(‘wp_page_numbers’)) { wp_page_numbers(); } ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
- The topic ‘First post appearing on multiple pages’ is closed to new replies.