我有以下函数返回当前帖子的标签:
<?php the_tags( \'<ul> <li>\', \'</ li> <li>\', \'</ li> </ ul>\' ); ?>
示例:

有没有办法把结果分成两列?
将返回如下内容:

欢迎任何提示。谢谢朋友们!
最合适的回答,由SO网友:s_ha_dum 整理而成
使用get_the_tags
而不是the_tags
获取一组标记,然后array_chunk
将其拆分。然后需要构建一个循环来显示标记。
$tags = get_the_tags();
if (!empty($tags)) {
$tags = array_chunk($tags,ceil(count($tags)/2),true);
foreach($tags as $v) {
echo \'<ul>\';
foreach ($v as $tag) {
echo \'<li><a href="\'.get_tag_link($tag->term_id).\'">\' . $tag->name . \'</a></li>\';
}
echo \'</ul>\';
}
}
参考
http://codex.wordpress.org/Function_Reference/get_tag_link