WordPress.org

Ready to get started?Download WordPress

Forums

How to Display Excerpted Posts without links (5 posts)

  1. ThomasHolmes
    Member
    Posted 7 years ago #

    Hi there!

    I want to display excerpted posts (using <!--more-->) on my homepage but in such a way that links are not active?

    Is there a way to do this?

    I guess I can put in the text as an optional excerpt but it'd be better if I could do it with a template function or similar.

    Thanks in advance!

    Thomas

  2. moshu
    Member
    Posted 7 years ago #

    Which links not to be active?

  3. ThomasHolmes
    Member
    Posted 7 years ago #

    Hi Moshu,

    Thanks for getting back to me!

    At the moment I use the <!--more--> tag to mark out which part of the post should be displayed on the blog homepage. This is normally the first paragraph of the post. Often there are links in this first paragraph.

    So I wanted to know if there was a way to display this excerpt on the homepage, with the links removed. Just the text without the links.

    Maybe links being not active isn't the right terminology.

    I would like to display the extract without links.

    Does that make more sense?

    Thomas

  4. moshu
    Member
    Posted 7 years ago #

    Yep. Don't use the "more" thing.
    Replace the_content tag in your index.php file with the_excerpt: it will automatically strip the html tags (i.e. no links, no images).
    See the details:
    http://codex.wordpress.org/Template_Tags/the_excerpt

  5. ThomasHolmes
    Member
    Posted 7 years ago #

    That's brilliant! Thanks for your help Moshu!

Topic Closed

This topic has been closed to new replies.

About this Topic