WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Is it possible to make a link from excerpt? (5 posts)

  1. danielb
    Member
    Posted 5 years ago #

    Hello!

    I'd want to achieve such layout in archive.php page:

    <h2><a href=post_permalink>Post title</a></h2>
    <p><a href=post_permalink>Post excerpt ... tincidunt litterarum diam feugiat in ipsum</a></p>

    Is it possible at all? I've searched the forum and the web but haven't found any solution on how to display entire excerpt as a link.

    Thanks in advance.

  2. t31os
    Member
    Posted 5 years ago #

    The excerpt already adds <p> tags i think, so why not just do...

    <a href="yourlink"><?php the_excerpt(); ?></a>

  3. danielb
    Member
    Posted 5 years ago #

    Unfortunately, XHTML doesn't allow <p> inside <a>.

  4. t31os
    Member
    Posted 5 years ago #

    Then you'll need to re-write the excerpt filter via a function in your theme/ else edit a core file to change the tags generated.

    Was aware it's not XHTML, but wasn't sure if that matters...

  5. danielb
    Member
    Posted 5 years ago #

    I did more thorough search and found this topic:
    http://wordpress.org/support/topic/197815
    It works right in the template and doesn't require any mods.

    Thanks for your reply.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags