Forums

Make the whole excerpt linked to the_permalink (2 posts)

  1. frederfred
    Member
    Posted 2 years ago #

    Hi all!

    I'm wondering if it's possible to link the whole the_excerpt(); to the_permalink();.

    Ofcourse the easiest way would be to wrap an a-tag around the excerpt but since that doesn't validate, its out of the question.

    So, how can I filter the excerpt and have it echoed with an surrounding a-tag?

  2. jshreve
    Member
    Posted 2 years ago #

    You could use get_the_excerpt to intercept the output of get_excerpt before it is outputted, do what you need with it to get it to validate (strip out tags and the like) and then wrap it in a link tag using the_permalink.

Topic Closed

This topic has been closed to new replies.

About this Topic