WordPress.org

Support

Support » Plugins and Hacks » Advanced Category Excluder breaks w3c validation

Advanced Category Excluder breaks w3c validation

  • I’m using Advanced Category Excluder 1.4.3 on WordPress 2.9.2 here. When you modify the header to exclude google etc. you run this code (line 378 of advanced-category-excluder.php)…

    <—–cut—–>
    if($modifyheader)
    {
    echo ‘<meta name=”robots” content=”noindex, nofollow”>’.”\n”;
    echo ‘<!– A.C.E. by DjZoNe –>’;
    return true;
    }
    return false;
    <—-/cut—–>

    This breaks validation. When you open a page from a excluded category in http://validator.w3.org/ it says…

    <—–cut—–>
    # Error Line 1, Column 5384: end tag for “meta” omitted, but OMITTAG NO was specified

    …=”robots” content=”noindex, nofollow”><meta name=”description” content=”Als ei…

    You may have neglected to close an element, or perhaps you meant to “self-close” an element, that is, ending it with “/>” instead of “>”.
    <—-/cut—–>

    To solve this just add a / to the end of the meta tag before you close it

    <—–cut—–>
    if($modifyheader)
    {
    echo ‘<meta name=”robots” content=”noindex, nofollow” />’.”\n”;
    echo ‘<!– A.C.E. by DjZoNe –>’;
    return true;
    }
    return false;
    <—-/cut—–>

    …and the problem is solved.

    http://wordpress.org/extend/plugins/advanced-category-excluder/

  • The topic ‘Advanced Category Excluder breaks w3c validation’ is closed to new replies.