SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    empty <p> tags not in my code show up in wp.

    Hello all.
    was wondering how do I get rid of these tags?
    I didn't put them in my code. This happens also after i placed the text in notepad to strip it of any possible coding.
    I think it is causing problems in validator and it is adding extra spaces when not needed in my layouts.

    invisiblePtags.jpg

    thanks
    D

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Its probably from the Wordpress function that sets the text spacing, new lines etc. It replaces (or augments) the PHP function nl2br but uses paragraphs to keep the formatting you type in.

    I wouldn't worry about them to be honest, if you see the function you will understand why!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Also I keep getting this in validator
    Error Line 184, Column 4: No p element in scope but a p end tag seen.

    </p>
    I am thinking it is tied to that.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,297
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    My offhand guess would be that you have some returns in your text editor that WP is automatically turning into empty <p> tags. See if it fixes things to delete anything after the final word. (I see clients entering content with extra returns like this all the time, and it drives me nuts.)

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2005
    Posts
    1,849
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Wordpress is buggy with its auto formatting and especially with its insertion of <p> tags. I had to go so far as to disable auto <p> tags by using a plugin. Instead of <p> tags I have faux paragraphs using <br> tags. It is not what I would prefer but it is better than the buggy paragraph tags appearing where you don't want them and screwing up everything. I found the problem worst when using certain HTML tags like <code>.

    http://wordpress.org/plugins/wpautop-control/
    http://codex.wordpress.org/Function_Reference/wpautop

  6. #6
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    well. it is throwing off the padding and margins in the layout.
    I'd love to know how to get rid of it.

  7. #7
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,227
    Mentioned
    194 Post(s)
    Tagged
    2 Thread(s)
    It might be the editor you're using. AFAIK the WYSIWYG is the one that adds p tags, the other doesn't.

  8. #8
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    well i just used the wp section to create the pages
    even used notpad to strip it of possible code before i pasted it in.

  9. #9
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi Cheesedude, thank you for the advice. Will look into that plugin.
    D


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
  •