Hey. I am trying to get the categories associated with a post in a meta section using the following code:
<div>FILED AS: <span class="gf-post-meta-result"><?php the_category(' • ') ?></span></div>
WordPress generates markup like:
<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>
Problem:
This part of rel="category tag" generated by wordpress makes my code invalid. W3c Validator gives an error message:
The rel attribute bad value category tag for element a: the category of strings is not a registered keyword or an absolute URL. Space in the path component. Use% 20 instead of spaces.
β¦w all posts in Uncategorized" rel="category tag">Uncategorized</a></span></div>
Any idea how to fix this?
source share