error validation W3C HTML5 the_category rel attribute (3 posts)

  1. minimamente
    Posted 4 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?


  2. Toxin
    Posted 4 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
    Posted 3 years 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