0

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();
}
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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