SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Nov 2008
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wordpress auto <p> insertion around my images

    Having some trouble with wordpress inserting <p> tags around my img

    my code:

    <div>
    <img />
    <p>MY PARAGRAPH HERE<p>
    </div>

    but wordpress changes this to

    <div>
    <p><img /><p>
    <p>MY PARAGRAPH HERE<p>
    </div>

    I don't want those <p> tags around my image, is there a way to disable this auto insertion? thanks

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What I do is get rid of all white space:
    Code HTML4Strict:
    <div><img /><p>MY PARAGRAPH HERE<p></div>
    That seems to get rid of the auto <p>.

  3. #3
    SitePoint Guru
    Join Date
    Nov 2008
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried that but it didn't work, probably because the <div> part is in my template, so in the post content the <img /> tag is the first thing entered.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •