解惑

解己之惑,解人之惑

wp_list_cats

今天又验证了下首页,发现又不符合XHTML1.0标准了,问题的根源在于我修改了分类输出的代码:
<h2>分类</h2>
<ul class="counts">
    <?php wp_list_cats(‘sort_column=name&optioncount=1&hierarchical=0&feed_image=/images/feed.gif’); ?>
</ul>

这样输出的图片的内容为:
<img src=‘/images/feed.gif’ />

这个输出不符合XHTML1.0标准,需要ALT属性,看了下Wordpress的源代码(template-functions-category.php)中wp_list_cats的实现,发现要输出ALT就必须指定Feed选项的值,修改后的结果:
<h2>分类</h2>
<ul class="counts">
    <?php wp_list_cats(‘sort_column=name&optioncount=1&hierarchical=0&feed_image=/images/feed.gif&feed=Feed’); ?>
</ul>

(Visited 197 times, 1 visits today)

1 Comment

  1. 微软的Microsoft.com已经确认完全升级到Windows Server 2008群集,相关的微软技术人员和博客们笑称微软在吃自己的“狗粮”(泛指测试中的软件).

发表评论

邮箱地址不会被公开。 必填项已用*标注

© 2024 解惑

本主题由Anders Noren提供向上 ↑