欢迎光临
我们一直在努力

如何调用wordpress的父分类和归档页以及子分类名称和链接函数

调用wordpress的父分类和归档页以及子分类名称和链接函数代码如下:

<?php if ( is_category() ) { $this_category=g et_category( $cat ); } ?>
<?php if ( $this_category->category_parent ) 
$this_category = wp_list_categories( 'orderby=id&show_count=0&title_li=&use_desc_for_title=1&child_of='.$this_category->category_parent."&echo=0" ); 
else $this_category = wp_list_categories( 'orderby=id&depth=1&show_count=0&title_li=&use_desc_for_title=1&child_of='.$this_category->cat_ID."&echo=0" ); 
if ( $this_category ) { ?>
<ul>
<?php echo $this_category; ?>
</ul>
<?php } ?>

 

赞(0) 打赏
未经允许不得转载:新起点博客 » 如何调用wordpress的父分类和归档页以及子分类名称和链接函数


关注公众号『新起点软件管家』

获取最新网络资源及破解软件!
带你玩转各样软件...

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏