• I have a layout with two divs – the left shows a list of post thumbnails, with previous and next paging, the second div shows the selected post.

    The problem I’m trying to figure out is that if i am on the second page of posts and select one, the post loads, but the left div pagination is reset to the first page, instead of ‘remembering’ which page it was on.

    This is how the list is called:

    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $wp_query->query('category_name=thumbnail'.'&showposts=9'.'&paged='.$paged);
    ?>
    <a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>">
    
    <!--code to call a thumbnail here-->
    </a>
    
    <?php endwhile; ?>
    
    <div class="navigation">
      <div class="alignleft"><?php previous_posts_link('&laquo; Previous') ?></div>
      <div class="alignright"><?php next_posts_link('More &raquo;') ?></div>

    The post itself is called like this:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post_full" id="post-<?php the_ID(); ?>">
    	<?php the_content(); ?>
    <?php endwhile; else: ?>
    		<?php endif; ?>

    I’m thinking maybe there is a better way I could be doing this. Any suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ColinG

    (@coling)

    Thanks for the reply. That link is actually where it got the paging code from, it’s just that for what I’m trying to do it doesn’t cover all the bases.

    The paged listing need to appear as well as the post that has been clicked on. What happens at the minute, is that when a listing has been clicked, the relevant single post page is loaded, but the paging is reset to the first page.

    For example, if i went to page 3 in the listing and chose an post, the post loads, but the paging of the list goes back to page 1, rather than staying on page 3, which is what I want it to do.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘paged post list and single post’ is closed to new replies.