2024年10月14日 建站教程
功能介绍:把Tag标签当做keywords来使用,但是如果直接调用the_tags()方法会出现超链接问题,所有需要重新定义一个方法!
function tagtext(){
global $post;
$gettags = get_the_tags($post->ID);
if ($gettags) {
foreach ($gettags as $tag) {
$posttag[] = $tag->name;
}
$tags = implode( ',', $posttag );
echo $tags;
}
}
页面中调用方法:
<?php tagtext();?>
本文链接:http://so.lmcjl.com/news/15379/