Menu flag icons cause validation errors
-
The flag icons displayed in the navigation menu have <img> tags which are missing two properties. As a result, the code breaks when validated as xhtml (http://validator.w3.org/). WordPress itself uses xhtml (see http://codex.ww.wp.xz.cn/HTML_to_XHTML ), so that’s why I use the xhtml doctype.
1. The alt attribute is missing. (Required in html 4, 5 and xhtml)
2. The end tag for <img> is omitted. (Can be omitted in html 4 and 5, but not in xhtml)Current output:
<img src=”path_to_icons/fr.png”>Desired output:
<img src=”path_to_icons/fr.png” alt=”flag (fr)” />
// perhaps a different text inside the alt attributeI did a search online as well as on this support forum, but couldn’t find any solutions. So I had a look into the code and found these properties to be missing indeed. See qtranslate_frontend.php, version 3.1, line 169 and 196, where the <img> tags are generated.
Thanks for looking into this issue! 🙂
The topic ‘Menu flag icons cause validation errors’ is closed to new replies.