Forums

[resolved] Bug: excerpt repeat on category pages (8 posts)

  1. trapalion
    Member
    Posted 2 years ago #

    Hi all!

    I can't have posts display as excerpts in the category pages:

    I've tried to change 'the_post' with 'the_excerpt' on the archive.php file but then the excerpt (there's only one post on the category for the moment) repeats itself thousands of times, and the text appears outside the box as you can see there: http://img10.hostingpics.net/pics/410064extrait.jpg

    I think i should change something else in the archive.php file but sadly I don't know anything about php...

    Here is the code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    It would be great should you have any idea where the problem comes from.
    Cheers
    T

  2. PBP_Editor
    Member
    Posted 2 years ago #

    Did you forget to close the loop?

    <?php endwhile; ?>

  3. trapalion
    Member
    Posted 2 years ago #

    No I do have the '<?php endwhile; ?>', might be misplaced though?

  4. Mark / t31os
    Moderator
    Posted 2 years ago #

    Post your code up (in a pastebin) and we'll take a look... ;)

  5. trapalion
    Member
    Posted 2 years ago #

    here is the pastebin: http://wordpress.pastebin.ca/1859164

    thx for the help anyway!!!

  6. Mark / t31os
    Moderator
    Posted 2 years ago #

    Can't see a problem with the code(other than one, see below), apart from the lack of indenting(which makes it very hard to read).

    One note though, after re-reading your initial post..

    You should not be replacing the_post() it does not do what i think you think it does..

    the_content() is responsible for display the content of each post, that is what you'd replace with the_excerpt()..

    So this line..

    <?php while (have_posts()) : the_excerpt(); ?>

    Should be switched back to..

    <?php while (have_posts()) : the_post(); ?>

    And it's this line you should be replacing..

    <?php the_content('View Full Article &raquo;'); ?>

    ..with..

    <?php the_excerpt(); ?>

    Hope that helps..

  7. trapalion
    Member
    Posted 2 years ago #

    it worked!!
    thanks very much ;)

  8. Mark / t31os
    Moderator
    Posted 2 years ago #

    You're welcome.. :)

Topic Closed

This topic has been closed to new replies.

About this Topic