Pagination and query_posts
-
I am having a problem with using query posts and the pagination system when I click page 2 etc. it refreshes page 1. Has anyone got any suggestions?
Due to the design I am showing the full post and under that I have a second loop to show two of the excerpts with the paginator to show the rest of the posts
Here is my code
`<div id="newscontent">
<?php query_posts('showposts=1'); ?>
<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<div class="date">Written by <span class="author"><?php the_author() ?></span> On <span class="author"><?php the_time('F jS, Y') ?></span> Posted in <?php the_category(', ') ?></div>
<?php the_content('Read the rest of this entry »'); ?>
<div class="clear"></div>
</div><!--end of homecontent-->
<?php endwhile; endif; ?>
</div><!--end of maincol-->
<div id="maincolbot"></div>
<div id="excerptboxes"><?php if (have_posts()) : ?>
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("posts_per_page=2&offset=1&paged=$paged"); ?><?php while (have_posts()) : the_post(); ?>
<div class="excerpts">
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<p><?php excerpt('40'); ?> </p>
<div class="excerpt_bottom"></div>
</div><!--end of excerpts-->
<?php endwhile; ?>
<div class="clear"></div><div id="navigation">
<?php if(function_exists('wp_page_numbers')) : wp_page_numbers(); endif; ?>
</div><?php endif; ?>`
- The topic ‘Pagination and query_posts’ is closed to new replies.