Removing <p></p> from the_excerpt() output? (5 posts)

  1. ApexDesignChief
    Posted 7 years ago #

    I am having trouble with the html that WordPress adds to things like excerpts and such.

    I have kind of a tight layout in mind and when I call the_excerpt() from within the Loop, WordPress encases the given excerpt in <p> tags when displaying in the browser. Also does this to the post content when I use the_content()

    This is causing vertical height problems in my layout, I don't want the extra blank lines in there.

    Is there a way to customize the output of these WP tags? I looked in the post-template.php file but couldn't grasp what it was doing :(

    Any help would be much appreciated!

  2. Jorge A. Gonzalez
    Posted 6 years ago #

    I am having the same sort of issues.

  3. Michael
    Forum Moderator
    Posted 6 years ago #

    <?php echo get_the_excerpt(); ?>
    in place of:
    <?php the_excerpt(); ?>

  4. alexlr
    Posted 6 years ago #

    This worked perfectly. Was looking for the exact same thing. Thank you!

  5. pushpinderbagga
    Posted 6 years ago #

    lol works like a gem ... thanks a lot!

Topic Closed

This topic has been closed to new replies.

About this Topic