Support » Themes and Templates » Is it possible to make a link from excerpt?

  • Resolved danielb

    (@danielb)


    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • t31os

    (@t31os)

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

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

    danielb

    (@danielb)

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

    t31os

    (@t31os)

    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…

    danielb

    (@danielb)

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Is it possible to make a link from excerpt?’ is closed to new replies.