Forums

[resolved] How to get <p> out of the_excerpt? (5 posts)

  1. mbalara
    Member
    Posted 3 years ago #

    Easy question: when I use the_excerpt, it spits out the content enclosed in <p></p>. How do I makes those go away? I.e. how do I get *just* the content that's actually in the excerpt field?

    More complicated background info: I've just imported over 260 posts into WP from MT. In MT I was using the excerpt field in each post for one image name, but without .jpg on the end. Yes, a dirty, filthy, stinking hack.

    *If* the_excerpt would leave the <p></p> out, then what I need would look something like this: <img src="<?php the_excerpt(''); ?>.jpg">.

  2. whooami
    Member
    Posted 3 years ago #

    hands down, the nicest plugin for handling all sorts of text problems is Text control, http://dev.wp-plugins.org/wiki/TextControl

    what you are fighting against is called wpautop, there are other plugins that allow you disable it on a post to post basis, this one allows that, as well as allowing for a default way to handle all posts.. it also lets you use markdown, textile, etc..

    As for your last request there.. i dont have a clue.

  3. BPartch
    Member
    Posted 3 years ago #

    Hello

    Here is a plug in a friend made for me to do just that

    http://benpartch.com/forum-examples/no-excerpt-p.zip

    Just upload it to your wp-content/themes folder and then activate it in the control panel.

  4. mbalara
    Member
    Posted 3 years ago #

    @whooami: Um, which last request? I actually only had one. If that plugin will get the <p></p> out, then I'm good to go. Thanks!

  5. mbalara
    Member
    Posted 3 years ago #

    @BPartch: Oh oh oh! Even better! Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags