What are you using for you 2 Loops – get_posts or query_posts?
query_posts. Here are the two loops:
This one gets Post Thumbnails (I’m using 2.9 beta)
<?php query_posts('showposts=5'); ?>
<?php while (have_posts()) : the_post(); ?>
<li>
<?php the_post_image('full'); ?>
</li>
<?php endwhile;?>
This one for excerpts
<?php query_posts('showposts=5'); ?>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><h2><?php the_title(); ?> | <?php the_time('m.j.y') ?></h2><?php the_excerpt(); ?></a></li>
<?php endwhile;?>
So with this code, I’m able to have post thumbnails in one div, excerpts in another.
The problem even happens when using one loop on a page, but where the the_title tags comes well after the end of the loop, and this time, I’m using a secondary loop.
<?php
$childProjects = new WP_Query();
$childProjects->query('post_type=pagepost_parent='.$post->ID);
?>
<?php
while ($childProjects->have_posts()) : $childProjects->the_post();
?>
<li>
<?php
get_the_image( array('default_size' => 'full', 'link_to_post' => false) ); ?>
</li>
<?php endwhile;?>
<h1><?php the_title(); ?></h1>
lol
THANKS EVERYONE!
I found the answer. I had to reset the queue, to make sure it was dead.
<?php wp_reset_query(); ?>
This goes for other things too, like if you’re calling a post_thumbnail for the page after a have a loop that is collecting posts. The post_thumbnail for the last image will be called instead, unless you reset the query.