• nickaster

    (@nickaster)


    Howdy –

    I’m making use of this code to display exceprts of my posts:

    <?php the_excerpt(); ?>

    Is there a way to strip the <p> tags out of it? I’d like to include some other stuff around it, but the <p> tags keep getting in the way.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)

    Try using <?php strip_tags( the_excerpt() ); ?>.

    Thread Starter nickaster

    (@nickaster)

    Hmm… it still slaps <p> tags around the outside. like:

    <p>THE EXCERPT IS HERE….</p>

    esmi

    (@esmi)

    I’ve used a variation on:

    <?php $my_output .= strip_tags( apply_filters('the_excerpt', get_the_excerpt() );
    echo $my_output;?>

    quite successfully.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Getting the “p” tags out of the exceprt’ is closed to new replies.