WordPress.org

Ready to get started?Download WordPress

Forums

error validation W3C HTML5 the_category rel attribute (3 posts)

  1. minimamente
    Member
    Posted 2 years ago #

    How to resolve the problem of W3C in HTML5 for the rel attribute?

    the_category give to me the rel="category tag" instead of one correct, for example rel="category-rel".

    The problem is the whitespace in the rel attribute.
    Have found any solution for that?

    Thanks!

  2. Toxin
    Member
    Posted 2 years ago #

    Same issue here. Do we have to update the get_the_category_list() function by ourselves or is there a way to tell wordpress to generate HTML5 compliant code outputs ?

  3. zakkath
    Member
    Posted 1 year ago #

    I fixed it by adding this to my functions.php file:

    /add_filter( 'the_category', 'replace_cat_tag' );
    
    function replace_cat_tag ( $text ) {
    $text = str_replace('rel="category tag"', 'rel="tag"', $text); return $text;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic