• working-together

    (@working-together)


    I am getting a “there is no attribute ‘role'” validation error on my <div id=”sidebar” role=”complementary”> DIV.

    The error message says “you must use the “Transitional” document type to get the “target” attribute”

    As below I believe I am. Can someone point me in the right direction on how to resolve this error please? I did not define for my sidebar to have a “complementary” role it is just how WordPress and the code I used is putting my dynamic sidebar together.

    I have created a dynamic sidebar before, but never sar this “complementary role”

    Any idea where this may be coming from? I’d research it, but not quite sure where to start.

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;

Viewing 10 replies - 1 through 10 (of 10 total)
  • esmi

    (@esmi)

    Sounds like you’re using a copy of the default theme which does include these (HTML5) attributes.

    Thread Starter working-together

    (@working-together)

    Yeah, I am trying to learn wordpress by looking through the code of the default theme and seeing how they put together dynamic sidebars with unordered lists. Along with http://codex.wordpress.org/Styling_Lists_with_CSS .

    I’m doing something wrong as this is the only validation error I am getting.

    Do you suggest a different way to put together dynamic sidebars?

    I’ve actually looked at other themes and none of them have this Role attribute besides the default one.

    Thread Starter working-together

    (@working-together)

    I actually ran the default theme through the validator and it gets an “attribute” connected error also. Maybe this isn’t the way I want to go.

    esmi

    (@esmi)

    The fault is within the default theme – not your markup. It’s a known issue that (hopefully) will be resolved when the new default theme is released in WP 3.0.

    Thread Starter working-together

    (@working-together)

    I’m actually trying to work through making my own custom site. I’m doing it locally (Xampp) and it has been funn-ish. My only validation error for my site on both CSS and my HTML has been this attribute error. Can you take a look at my multiple sidebar code below and see if what I did is passeable. All the sidebars work and look exactly how I want them to look. It’s just this “attribute error”. Any suggestions would be great. I tried various ways, but this way seemed to give me the control I wanted.

    Theme Function:

    [Code & CSS moderated as per the Forum Rules. Please use the pastebin]

    Thread Starter working-together

    (@working-together)

    Here is the pastebin link to my code as mentioned above.

    http://wordpress.pastebin.ca/1855402

    Thanks.

    esmi

    (@esmi)

    The function file looks fine as does the markup but it’s next to impossible to asses if a given piece of CSS is effective without seeing it in action on the site. All I can suggest is that you ensure that it’s valid and that you test the theme across as many different browsers as you can.

    Thread Starter working-together

    (@working-together)

    Thanks. I’m still working on it locally. I was trying to validate everything before going live.

    I actually saw a past post of yours to another person about this. You suggested just removing the the “role” attribute wherever it might be.

    I have scoured my files (I do use the default comments.php, but that’s it) and I just don’t know how this “role” attribute is showing up for my sidebar on my page.

    This is straining my obsessive behavior! As I have been scouring the web for the answer to this for the last 7 hours. Very frustrating.

    The only good thing is I have learned a lot of other things in the process.

    esmi

    (@esmi)

    Have you looked in sidebar.php?

    Thread Starter working-together

    (@working-together)

    I actually figured it out. Well, kind of, as I don’t understand the why. For whatever reason the way I had it, the “role” attribute was being put in automatically.

    I actually renamed my #sidebar div to #sidecontent . Now the “role” attribute isn’t brougt over and my page validates.

    As long as it works : ) .

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘There is no attribute “role” Validation error….’ is closed to new replies.