Support » Fixing WordPress » [resolved] Dynamic Sidebar and Markup Validation

  • So I ran my site http://graphicscove.com/ through the W3 validator http://validator.w3.org/ and apart from all the other errors that I’m in the process of fixing 😉 I came across the dynamic sidebar code causing some error in the markup making it invalid.

    The code I’m using to generate the sidebar is:
    <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘footer_one’) ) : ?><?php endif; ?>

    <id="text-3" class="widget-container widget_text"><h3 class="widget-tit…

    An attribute name (and some attribute values) must start with one of a restricted set of characters. This error usually indicates that you have failed to add a closing quotation mark on a previous attribute value (so the attribute value looks like the start of a new attribute) or have used an attribute that is not defined (usually a typo in a common attribute name).

    Shouldn’t it start with a <div id="" rather than just an <id="" as it’s giving me the above error in the validator.

    Am I right in thinking the dynamic sidebar code generates bad markup? Or am I missing something?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    Am I right in thinking the dynamic sidebar code generates bad markup?

    the markup is (probably) set in functions.php of your theme, with the ‘register_sidebar()’ function:
    http://codex.wordpress.org/Function_Reference/register_sidebar

    (only seems to effect the footer widgets in your site)

    Thanks for the suggestion, I’ll see if that comes up with anything.

    I have 5 dynamic sidebars in total, 3 footer ones, one on the blog page and one on the contact page. I’m getting the same errors with all of them.

    Sorted, it was due to the functions.php settings. Looks like everything is validating fine now, thanks alchymyth!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[resolved] Dynamic Sidebar and Markup Validation’ is closed to new replies.