Question

the_category() function in WordPress generates some invalid markup by creating an anchor tag with a rel attribute that looks like "category tag" (see the markup for the "Uncategorized" link here).

It seems the problem is category is not a valid value, and also it should be one word.

Most people are deleting it completely, but I was looking at the list of valid values and was wondering if any of them would be appropriate for a link to category page (such as this one)?

In particular tag, section, and subsection caught my eye, but their intended uses are not clear to me.

Était-ce utile?

La solution

category and tag are valid values. Some validators are not up to date.

tag is defined in the HTML5 spec.

category is listed at http://microformats.org/wiki/existing-rel-values#HTML5_link_type_extensions, which is the normative registry for link type extensions.

If both link types apply, it's correct to separate them with whitespace.

Note: don't use these link types on any link to the category/tag page; only use it where the linking page is categorized/tagged with the corresponding category/tag. So a page listing all categories shouldn't use the rel value "category" for the links.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top