multiple loop issue – previous posts page is wrong!?
-
hi!
i have been trying to do something where i show my newest post so it looks different to the other ones. i have been using multiple loops for this… that seems all good, however when you click on “older posts” it has a problem as it still shows the newest post on each page.
so for example when you go to the second page, instead of having just older posts, the top post will be my newest post and then the older ones will be below. – i only want to show my newest post on the front page. (i hope you can understand what i mean from my poor explanation!)
could someone help me on this one please? i would really appreciate it.
this is the site i have the problem on (i know its crap but i am trying!) https://www.mariosuniverse.com/blog
here is my code… (thanks in advanced)
<?php get_header(); ?> <div class="top"></div> <div id="main-content"> <div class="loop"> <?php $my_query = new WP_Query('category_name=featured&posts_per_page=1'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID;?> <div id="datebox"> <p class="day"><?php the_time('d') ?></p> <p class="month"><?php the_time('M') ?></p> <p class="year"><?php the_time('Y') ?></p> </div> <div class="star"></div> <div class="clear"></div> <div id="post-<?php the_ID(); ?>"> </div> <!-- did wierd stuff with this when i moved "loop" up! --> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php the_title(); ?></a></h2> <?php the_content('Read The Article / Have your say!'); ?> <!-- <p><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> </p> --> </div> <br /> <br /> <div class="shroom"></div> <br /> <br /> <br /> <?php endwhile; ?> <?php if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?> <div id="datebox"> <p class="day"><?php the_time('d') ?></p> <p class="month"><?php the_time('M') ?></p> <p class="year"><?php the_time('Y') ?></p> </div> <div class="star"></div> <div class="clear"></div> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php the_title(); ?></a></h2> <?php the_content('Read The Article / Have your say!'); ?> <!-- <p><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p> --> <br /> <br /> <div class="shroom"></div> <br /> <br /> <br /> </div> <?php endwhile; ?> <ul> <li><?php next_posts_link('« Older Entries') ?></li> <li><?php previous_posts_link('Newer Entries »') ?></li> </ul> <?php else : ?> <h2>Not Found</h2> <p>Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?> <?php endif; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
[moderated–bump removed. Please refrain from bumping as per Forum Rules]
- The topic ‘multiple loop issue – previous posts page is wrong!?’ is closed to new replies.