WP Loop Help
-
Hey there!
I need some help on fixing the WP Loop. On this page here, there are supposed to be 3 loops, one that shows the most recent post at the top regardless of what category. And the other two show the most recent post from either the Books or Wine/Food categories, also making sure not to repeat posts.
However, I can’t get the bottom two loops to show that. I have 3 posts up, one for each category (uncategorized, books, and winefood) and yet only the winefood one is showing up?
How can I fix this?
The bottom two WP loop code:
<div class="indextitles"> <div class="titlebooks">Latest Books</div> <div class="fw">Latest Food/Wine</div> </div> <div id="indexcontent"> <?php $mycats = array(3,4); // the category ID numbers foreach ($mycats as $catid) : query_posts(array('cat'=>$catid,'showposts'=>2)); $x=0; while (have_posts()): the_post(); if ($post->ID != $do_not_duplicate && $x < 1) { ?> <div class="index" id="post-<?php the_ID(); ?>"> <div class="date"><?php the_time('F jS, Y') ?></div> <div class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></div> <?php the_excerpt();?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">Read more...</a> <?php $x++; echo "</div>"; } endwhile; endforeach;?> </div>
Thanks,
Eric Huang*EDIT* Sorry, just realized that. Fixed it. Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘WP Loop Help’ is closed to new replies.