I am trying to get the categories associated with a post in it’s meta section by using the following code:
<div>FILED AS: <span class="gf-post-meta-result"><?php the_category(' • ')
?></span></div>
WordPress is generating the markup as:
<div>FILED AS: <span class="gf-post-meta-result">
<a href="http://localhost/test/category/uncategorized/" title="View all posts in Uncategorized" rel="category tag">Uncategorized</a>
</span></div>
This part rel="category tag"
is making my code invalid. W3C validator throws an error saying:
Bad value category tag for attribute rel on element a: The string category is not a registered keyword or absolute URL. Whitespace in path component. Use %20 in place of spaces.
â¦w all posts in Uncategorized” rel=”category tag”>Uncategorized
Any idea how to rectify this?
Filter
the_category
, and remove those attributes: