Forums

Navigating trough my own loop (2 posts)

  1. arroba3
    Member
    Posted 3 years ago #

    Hello there!

    I'am having a big head ache with this.The thing is that I've been trying to create my own loop for a category page (You can see it in here) and when I finished all seemed perfect! Until I press "The next page" link. The structure gets all messed up!! Here you have my code, simplified:

    <?php query_posts('showposts=2&cat=4'.'&paged='.$paged); while(have_posts()) : the_post(); $do_not_duplicate[] = $post->ID;?>

    <--- The Post Structure --->

    <?php endwhile; ?>
    <?php query_posts('showposts=4&cat=4'.'&paged='.$paged); while(have_posts()) : the_post(); $do_not_duplicate2[] = $post->ID;
    if($post->ID == $do_not_duplicate[0] ||
    $post->ID == $do_not_duplicate[1] ||
    $post->ID == $do_not_duplicate[2]
    ) continue; update_post_caches($posts)?>

    <--- The Post Structure --->

    <?php endwhile; ?>

    <?php query_posts('showposts=6&cat=4'.'&paged='.$paged); while(have_posts()) : the_post();
    if($post->ID == $do_not_duplicate[0] ||
    $post->ID == $do_not_duplicate[1] ||
    $post->ID == $do_not_duplicate[2] ||
    $post->ID == $do_not_duplicate2[0] ||
    $post->ID == $do_not_duplicate2[1] ||
    $post->ID == $do_not_duplicate2[2] ||
    $post->ID == $do_not_duplicate2[3] ||
    $post->ID == $do_not_duplicate2[4]
    ) continue; update_post_caches($posts);?>

    <--- The Post Structure --->

    <?php endwhile; ?>

    Any ideas? Enter to the link i put above and you'll see what I want to get. Then click to go to the 2nd page, and you'll see my problem.

    Thank you!

  2. s_ha_dum (was apljdi)
    Member
    Posted 3 years ago #

    This kind of thing screams 'bad markup' to me. Both pages have significant errors. I'd get that fixed first. The markup may not be the whole problem but with invalid markup the display is going to be squirrelly no matter what so that's the first place to start.

Topic Closed

This topic has been closed to new replies.

About this Topic