WordPress.org

Ready to get started?Download WordPress

Forums

Remove p tags from images (2 posts)

  1. downFast
    Member
    Posted 4 years ago #

    Hi,
    I have read a lot but i still can't find a solution.
    Wordpress adds p tags around my content, but it does wrap an img within a p tag too.

    I would like not to have the image within the p tag but leave the text only within p tags.

    Any help?

  2. Scoe
    Member
    Posted 4 years ago #

    WordPress automatically applies <p> tags to almost everything, the only way round it that I have found is to either disable <p> tags completely, which I wouldnt recomend, or to manually enter <div> tags around your images. This way you can style them seperately to a standard <p> tag

    the code should look like:
    <div class="banner"><img src="images/banner.jpg" alt="banner" title="banner" width="1000" height="230" class="alignnone size-full wp-image-64" /></div>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.