the_tags() 为方便起见,非常简单,如果希望对格式进行更多控制,请使用get_the_tags() 并根据需要输出它们。
编辑-模板的快速示例:
<?php
$posttags = get_the_tags();
if ($posttags) {
echo \'Read more about \';
$tag_count = count( $posttags );
$count = 0;
foreach( $posttags as $tag ) {
$count++;
if( $tag_count == $count )
$sep = \'.\';
elseif( $tag_count - 1 == $count )
$sep = \', and \';
else
$sep = \', \';
?>
<a href="<?php echo get_tag_link( $tag->term_id ); ?>" title=""><?php echo $tag->name; ?></a><?php echo $sep; ?>
<?php
}
}
?>