自学内容网 自学内容网

按分类调用标签 调用指定分类下的TAG

按分类调用标签 调用指定分类下的TAG

<?php
query_posts('category_name=news');
if (have_posts()) : while (have_posts()) : the_post();
if( get_the_tag_list() ){
echo $posttags = get_the_tag_list('<li class="jquery">','</li><li>','</li>');
}
endwhile; endif;
wp_reset_query();
?>

在制作wordpress主题时,有时候会用到按分类调用标签的时候,用上面的这一段代码就可以解决。

原文

https://www.wowsoho.com/news/530.html


原文地址:https://blog.csdn.net/jianzhanyes/article/details/142744571

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!