Support » Themes and Templates » Next/Previous Links from Home Page Show Same Posts (posts displayed in two sets)

  • relequestual


    Hi all.
    Ive seen this problem before ( However I cannot implement the solution.

    My home page shows posts in a slightly different way. Let me try and explain.
    The code below shows the first post.

    <!-- First Post -->
      	<?php $top_query = new WP_Query('showposts=1'); ?>
      	<?php while($top_query->have_posts()) : $top_query->the_post(); $first_post = $post->ID; ?>

    Then after, a different div style is used to display the next lot of posts for the page.

    <!-- Next few posts -->
      	        <?php $next_query = new WP_Query('showposts=6'); ?>
    		<?php while($next_query->have_posts()) : $next_query->the_post(); if(!($first_post == $post->ID)) : ?>

    This isn’t my theme, so I really lack the ability to understand how to edit it to implement the fix.

    Can anyone help me out here?

    thanks in advance


Viewing 1 replies (of 1 total)
  • I have the same problem. My first post code looks like this:

    <?php $top_query = new WP_Query('showposts=1'); ?>
    <?php while($top_query->have_posts()) : $top_query->the_post(); $first_post = $post->ID; ?>

    And secondary posts code i have changed to:

    if (is_home()) {
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

    Now with secondary posts everything is ok. When I press previous entries button secondary posts change to older ones but I still see my first post :(. What is the solution? Please help me. I was trying to search google for ages.. You can see how it works at

    Sorry for my English.

Viewing 1 replies (of 1 total)
  • The topic ‘Next/Previous Links from Home Page Show Same Posts (posts displayed in two sets)’ is closed to new replies.