I’m trying to work out a solution so that, within a multiple loop that displays 1) a sticky, 2) a list of posts, 3) a second list of posts, only one sticky shows though more than one may be defined.
This is my current code:
$myposts = new WP_Query('posts_per_page=8'); while ($myposts->have_posts()) : $myposts->the_post(); $do_not_duplicate = $post->ID?> <?php if ( is_sticky() ) : ?> //sticky stuff <?php else : ?> //first list of 7 posts <?php endif; ?> <?php endwhile; ?> <?php query_posts(array('post__not_in'=>$do_not_duplicate)); if (have_posts()) : while (have_posts()) : the_post(); ?> //second list of posts
Any ideas/help would be much appreciated!
- The topic ‘Single sticky within multiple loop’ is closed to new replies.