Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    Nov 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    easy W3C Validation question

    Hi. Thanks for looking at my post. I'm in the process of validating the html on my WP blog using W3C validation. I'm receiving this error:

    Code:
    document type does not allow element "p" here; missing one of "object", "ins", "del", "map", "button" start-tag .
    Now, the validator provides a link in the "source listing" portion of the page and the code and/or text that I see in the source listing does not reside in my local files. At least, I don't think it does cause I can't find it using search terms such as "Anyone", "thousands", "people", "worldwide", etc.

    This is text/code that the validator is pointing to that is causing the error.

    Code:
    <p>Hey,  Anyone out there want to be seen by thousands of people worldwide?  We
    I imputed this as part of a post using the admin at WP, so they're not in my local files (I don't think). I don't need to find that text necessarily, just edit the <p> tag before it. How can I find that particular <p> tag so I can edit it?

    Also, here's a link to my blog, so you can see for yourself. It's the first error.

    http://www.subcitizen.com/blog/

    Thanks so much for your time!!

    Jason

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Go into your wordpress admin area and edit the post. You'll have to edit the html source directly. Click on the HTML tab in the wordpress editor for that post.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Nov 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your help, _Aerospace_Eng_! I can't seem to find the html tab in WP admin. Here's a picture of the wordpress editor:











    I can edit the post, but not the html.

    Am I in the right place?

    Thanks,
    Jason

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Click on the View link on the right. I think that will allow you to switch back and forth. Your version of WP is outdated by the way. How long ago did you install it?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    Nov 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    "View" takes you to the actual post on the web page.

    I think I installed it, maybe six months ago.

    There's another tab you can see, called "files". That's where you can edit the code. However, I think that's the same code that's on my local files. So, I still won't be able to find the "<p>".

    I think when you create a post in WP. The text that you enter is saved to a database. So, there's no one file where you'll find the code of the page, and the written text of the post. How do I find the line of code that the validator told me to change?

    Thanks Again,
    Jason

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Looks like you'll have to go into the database and find that post to change it. You could try updating wordpress so you get the option to edit the html. I don't think it will mess up your layout. It may or may not.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    New Coder
    Join Date
    Nov 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you remember, I don't actually want to change the post itself, just the code before it. But I can't find the code before it (the <p>) because it's too generic. The W3C validator shows this as the error in question

    Code:
    <p>Hey,  Anyone out there want to be seen by thousands of people worldwide?  We
    with the "<p>" as causing the problems. How do I find that <p> if whenever I do a search for "Anyone", "thousands", "People" nothing shows up?

    Thanks Again _Aerospace_Eng_,

    Jason

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Sighs. The post is likely saved with multiple paragraph tags but you can't see this because you don't get to see the html. The html IS stored in the database which is why I said to look in the database. Quite searching for those terms. You aren't going to find them using Dreamweaver. You'll to go into your mysql database to find the post and delete the extra paragraph tags.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #9
    New Coder
    Join Date
    Nov 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks so much!! I think that's it. That's where I need to look. Hopefully, I can make the correct changes now. The validator mentioned:

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    So, I'll just find the <p> and delete it, and see what happens.

    Thanks again for your help. I really think you pointed me in the right direction!!!

    Thanks,

    Jason

  • #10
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    For what it's worth, the opening para tag doesn't appear to be a stray. Viewing source and stripping all content yields this structure for the cell:
    Code:
    <td> 
     <p> 
      <p></p>
      <p class="a2a_link"></p>
     </p>
    </td>
    Firebug doesn't match the tags up like that, though. But I came up with the same structure after stripping it twice (maybe too sleepy to be doing that!).

    Now, regarding the actual error, I had the same error a few days ago for putting a ul inside a para under xhtml 1.0 strict. For some reason, the validator considered the para to be an unacceptable block level container for the ul (don't know why). Moving it outside the para worked.

    It may also be doing something similar with you. The td may be flagged as an inline object for the purposes of validating contained block level elements, which it considers the para to be. I'm more inclined to believe that since, if you'll look at the source tree on up from there, you see those tables are nested within divs inside table cells rather than directly within the cells themselves, and the error specifically mentions tables (with paras) as one of the block level elements that should not be a child of an inline element. The template designer worked around the error by using the divs.

    In the end, though, I guess that's all no help for trying to get your page to validate. I'd bet on it being the text editor's fault as it may be saving the contents to the db in para tags. Some WP user may be able to confirm/deny that.
    Last edited by tomws; 11-20-2008 at 07:09 AM. Reason: sp

  • #11
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by tomws View Post
    For what it's worth, the opening para tag doesn't appear to be a stray. Viewing source and stripping all content yields this structure for the cell:
    Code:
    <td> 
     <p> 
      <p></p>
      <p class="a2a_link"></p>
     </p>
    </td>
    Firebug doesn't match the tags up like that, though. But I came up with the same structure after stripping it twice (maybe too sleepy to be doing that!).

    Now, regarding the actual error, I had the same error a few days ago for putting a ul inside a para under xhtml 1.0 strict. For some reason, the validator considered the para to be an unacceptable block level container for the ul (don't know why). Moving it outside the para worked.
    You can't have a paragraph within a paragraph. The only things allowed within a paragraph are inline elements such as a span, anchor, or image.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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