WordPress.org

Support

Support » Themes and Templates » How to Display Excerpted Posts without links

How to Display Excerpted Posts without links

  • 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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Which links not to be active?

    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

    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

    That’s brilliant! Thanks for your help Moshu!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to Display Excerpted Posts without links’ is closed to new replies.