What I’m trying to do, in simplest terms, is feature the 4 most recent posts on the index page, under that I have a graphic element. Under the graphic I’d like to feature the next 12 posts and the user would access the remaining posts in the next page(s).
I was able to accomplish the first bit using ‘showposts=4’. Obviously I don’t want to repeat the first 4 posts in the second loop and I was able to make sure that wasn’t a problem using ‘post__not_in’. However, I’m having a problem getting the second loop to show only 12 posts.
Here’s the code:
<?php query_posts(‘showposts=4’); $ids = array(); while (have_posts()) : the_post(); $ids = get_the_ID();?>
<?php query_posts(array(‘post__not_in’ => $ids,)); while (have_posts()) : the_post(); ?>
I’m not sure the way I’m doing is the most effective way, as I’ve learned the above from searching the internet (and I can’t write code very well). I feel like this should be an easy fix, it just seems to be out of my scope of understanding. I hope I’m being clear here.
Any and all help would greatly appreciated, thanks in advance!
- The topic ‘Multiple loops in chronological order’ is closed to new replies.