Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to edit the loop in my archive.php template so that when I visit a category page, it only displays the post excerpt and uses the featured image as a thumbnail.

When I add the_excerpt() to the loop it displays the excerpt of the first post, but then just keeps repeating it indefinitely?

Here's the loop I'm trying to edit / modify:

// Start the Loop
while (have_posts())  {                 
    the_excerpt();
    get_template_part('content', get_post_format());
}

// Display navigation to next/previous pages when applicable
if (theme_get_option('theme_bottom_posts_navigation')) {
    theme_page_navigation();
}
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

the_post - Iterate the post index in The Loop. Retrieves the next post, sets up the post, sets the 'in the loop' property to true.

 while (have_posts())  { the_post();

after you trigger the_post your the_excerpt shold return different values.

share|improve this answer
    
Thank You for sorting that out for me Code Monkey –  speedypancake Nov 17 '12 at 17:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.