DeepSeek探索全新的WordPress-AI插件(支持定制功能)点击立即了解
这里我们可以在调用Tag的 the_tags(”, ‘, ‘, ”); 替换成下面的代码即可。
$posttags = get_the_tags();
$count=0;
if($posttags) {
foreach($posttags as $tag) {
$count++;
if($count<3){
echo '<a href="' . get_tag_link( $tag ) . '" rel="tag" target="_blank">' . $tag->name . '</a> ';
}
}
}