WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Rel = Category Tag (6 posts)

  1. CNG SEO UK
    Member
    Posted 1 year ago #

    Error Line 85, Column 367: Bad value category tag for attribute rel on element a: The string category is not a registered keyword or absolute URL.

    …s in Uncategorized" rel="category tag">Uncategorized</span><span class="au…

    I understand this but I can not find it lol.....

    I keep getting W3C errors with this...

    Please advise

    Should it not be category_tag?

    Using 3.61 beta

  2. The W3C is no longer up to date and these errors should be ignored.
    If you try and validate other WordPress, you'll find the same thing.

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 1 year ago #

    The rel="category tag" is part of the rel-category microformat specification:
    http://microformats.org/wiki/rel-category

    Note that the W3C validator tools are meant as guides, not to be taken as absolute truths. Their checks may not be up to date with the current standards that are in widespread use.

  4. Should it not be category_tag?

    While this statement is highly debatable, some will argue that the "correct" (and I use the term very loosely) rel attribute should be tag. I'm not going to debate the validity of HTML validation but if you prefer you can use this filter I wrote that addresses the "issue"

    /**
      * Filters the_category() to output html 5 valid rel tag
      *
      * @param string $text
      * @return string
      */
    function html_validate( $text ) {
    	$string = 'rel="tag"';
    	$replace = 'rel="category tag"';
    	$text = str_replace( $replace, $string, $text );
    
    	return $text;
    }
    add_filter( 'the_category', 'html_validate' );
  5. CNG SEO UK
    Member
    Posted 1 year ago #

    ahh many thanks

  6. CNG SEO UK
    Member
    Posted 1 year ago #

    Ok have put this filter in and it works great thanks.......

    Thanks for your help I am obliged.

Topic Closed

This topic has been closed to new replies.

About this Topic