让WordPress通过HTML5校验
对于一个有洁癖的人,是会有一些奇奇怪怪的需求的。譬如我,手贱,跑去做W3C HTML5验证,发现WP3.2还是有标签不符合HTML5规范,罪魁祸首就是category tag这个标签。
度娘了一下,有WP的同学已有了解决方案了。
在functions.php假如如下代码即可。
<?php
foreach(array(
‘rsd_link’,//rel=”EditURI”
‘index_rel_link’,//rel=”index”
‘start_post_rel_link’,//rel=”start”
‘wlwmanifest_link’//rel=”wlwmanifest”
) as $xx)
remove_action(‘wp_head’,$xx);//X掉以上
//rel=”category”或rel=”category tag”, 这个最巨量
function the_category_filter($thelist){
return preg_replace(‘/rel=”.*?”/’,'rel=”tag”‘,$thelist);
}
add_filter(‘the_category’,'the_category_filter’);
?>
具体的看原地址吧:http://phoetry.me/archives/let-wordpress-pass-html5-validation.html