实现获取父类分类名称的方法
1 2 3 4 5 6 7 8 9 <?php $category = get_the_category…
| 
 1 
2 
3 
4 
5 
6 
7 
8 
9 
 | 
 <?php 
$category = get_the_category();
 
$parent = get_cat_name($category[0]->category_parent);
 
if (!emptyempty($parent)) {
 
echo $parent;
 
} else {
 
echo $category[0]->cat_name;
 
} 
?> 
 | 
类别:WordPress开发、 
		本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论功能已经关闭!