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>


作者: Cherami
原载: wp_list_cats
版权所有。转载时必须以链接形式注明作者和原始出处及本声明。

日志评价

1 Votes | Average: 5 out of 51 Votes | Average: 5 out of 51 Votes | Average: 5 out of 51 Votes | Average: 5 out of 51 Votes | Average: 5 out of 5 (1个投票,平均值: 5,最大值:5) --点击星星直接投票
Loading ... Loading ...


相关日志



随机日志



添加到网摘

[del.icio.us]  [新浪 VIVI]  [365key]  [YouNote]  [博采中心]  [Poco]  [SOHU狐摘]  [天极网摘]  [和讯网摘]
喜欢这个插件?

当前日志信息