The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

How to Display Excerpted Posts without links (5 posts)

  1. ThomasHolmes
    Posted 9 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!


  2. moshu
    Posted 9 years ago #

    Which links not to be active?

  3. ThomasHolmes
    Posted 9 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?


  4. moshu
    Posted 9 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:

  5. ThomasHolmes
    Posted 9 years ago #

    That's brilliant! Thanks for your help Moshu!

Topic Closed

This topic has been closed to new replies.

About this Topic