Ready to get started?Download WordPress


[resolved] Dynamic Sidebar and Markup Validation (4 posts)

  1. graphicscove
    Posted 2 years ago #

    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?

  2. alchymyth
    Forum Moderator
    Posted 2 years ago #

    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:

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

  3. graphicscove
    Posted 2 years ago #

    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.

  4. graphicscove
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic