WordPress.org

Ready to get started?Download WordPress

Forums

Converted to WP. Several validation errors! (7 posts)

  1. backspaces
    Member
    Posted 4 years ago #

    I've recently converted a website to WP (from Textpattern). Here's the url: http://backspaces.net/

    Looks fine. Spent a lot of time getting everything to work, but finally online.

    But: there a problem. It doesn't validate!
    http://validator.w3.org/check?uri=http%3A//backspaces.net/

    Is there something I need to know about converting to WP in order to have valid XHTML?

    Thanks .. sorry if this is too noob to believe.

    Owen

  2. backspaces
    Member
    Posted 4 years ago #

    BTW: If I validate just the first WP post .. the latest:
    http://backspaces.net/46/new-website-again/
    .. I still get validation errors:
    http://validator.w3.org/check?uri=http%3A//backspaces.net/46/new-website-again/

    Yikes! I hope this does not mean Classic is not valid, or that the HTML editor has a problem.

    Owen

  3. polchamdirector
    Member
    Posted 4 years ago #

    I am having the same problem. Can anyone recommend some themes that will validate. I need something along the line of the classic. Just one or two simple columns on the right.

    Thanks for the help.

  4. backspaces
    Member
    Posted 4 years ago #

    Well I found out that all but one of the validation problems was caused by the translation to WP from Textpattern. Not txp's fault, but mine.

    HOWEVER: there remains a problem in the search form: it uses an odd html form element in the general-template.php file:
    $form = '<form role="search" method="get" id="searchform" action="' . get_option('home') . '/" >

    This causes the validation error:
    Attribute "role" is not a valid attribute. Did you mean "frameborder" or "scrolling"?
    …s="widget widget_search"><form role="search" method="get" id="searchform" act

    So we're at the mercy of WP to upgrade, or simply hacking the core file ourselves.

    One upscale tidbit: I fixed the broken article from txp by simply editing the article doing nothing (insert space, then delete it), then saving it in the WYSIWYG editor. It looks at the html and fixes problems like improperly balanced tags! Way cool.

    Owen

  5. esmi
    Forum Moderator
    Posted 4 years ago #

    This causes the validation error:
    Attribute "role" is not a valid attribute. Did you mean "frameborder" or "scrolling"?
    …s="widget widget_search"><form role="search" method="get" id="searchform"

    It's a very minor issue. Specifically the inclusion of the HTML5 role attribute in a default theme with an XHTML DOCTYPE.

    So we're at the mercy of WP to upgrade, or simply hacking the core file ourselves.

    Uh!? It's in the theme - not the core files! Go amend the default theme yourself. Or make a copy, get rid of all of the references to the role attribute and save the result as a new theme. That way, your "custom" theme won't be over-written when you upgrade.

  6. backspaces
    Member
    Posted 4 years ago #

    No, its not in the theme. See:
    http://core.trac.wordpress.org/ticket/10108
    And they won't fix it even though it simply means deleting the phrase: role="search" in the file general-template.php.

    It can be easily fixed by adding a searchform.php file to the Classic theme however, although I think the default/fallback should be valid.

    Look: here's the rub -- I was hoping I could simply use CSS on the Classic theme to achieve my desired results, one of which was validation. I believe Classic will always give this validation error.

    I guess this is the WordPress Way, but I find it arrogant.

    Owen

  7. shantic
    Member
    Posted 4 years ago #

    I had the same problem with the role tag and then I found this piece of code, since I was using the sidebard to add the search this worked PERFECTLY:

    ob_start();
    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Left Side Index") ) : endif;
    $output = ob_get_contents();
    ob_end_clean();
    echo str_replace('role="search"', '', $output);

    just modify it to your needs (e.g change the name of the sidebar)

    I found this code on this site hope it works for you :)

Topic Closed

This topic has been closed to new replies.

About this Topic