On my blog I'm attempting to run three different areas containing content:
First, the loop, which I'd like to narrow to one (featured) category. This I've been able to do with the following, placed right before the loop:
<?php query_posts ($query_string . '&cat=4'); ?>
The second and third contain similar code, on which queries only items from one category, the other which queries items from all categories but one.
<ul>
<?php
global $post;
$myposts = get_posts('numberposts=5&offset=1&category=3');
foreach($myposts as $post) :
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
|| <span class="date"><?php the_time('F j, Y'); ?></span>
<div class="entry"></div><?php the_excerpt(); ?>
</li>
<?php endforeach; ?>
</ul>
Everything seems to work fine, except the_excerpt, which displays an excerpt of the one post over and over again. (The post is the latest chronological article that is NOT of the category defined in the query_posts call right before the main loop.) Titles and links display and act just fine.
So the question: how do I get the_excerpt to display an excerpt of the appropriate story (and not repeat)?
Thanks in advance for any help.