导读:网站搭建网站搭建//获取顶级分类ID加入函数function?salong_category_top_parent_id?($current_cat_ID)?{ ?while?建站技术技术猫建站。

//获取顶级分类ID加入函数function?salong_category_top_parent_id?($current_cat_ID)?{
?while?($current_cat_ID)?{
????$cat?=?get_category($currendede商城模板t_cat_ID);
????$current_cat_ID?=?$cat->category_parent;
????$catParent?=?$cat->cat_ID;
}
return?$catParent;
}
//调用方法
<?php?foreach((get_the_category())?as?$category){
$djcatid?=?salong_ca织梦模板安装tegory_top_parent_id?($category->cat_ID);
}?>
<?php
$args=array(
?'child_of'=>?$djcatid,
?'hide_empty'=>'0',
);
$categories=get_categories($args);
foreach($categories?as?$category)?{
echo?'<li><a?href="'?.?get_category_link(?$category->term_id?)?.?'"?title="'?.?sprintf(?__(?"View?all?posts?in?%s"?),?$category->name?)?.?'"?'?.?'>'?.?$category->name.'</a></li>';
}
?>相关建站技术技术猫建站。
关键词标签: 网站搭建 页面 名称
声明: 本文由我的SEOUC技术文章主页发布于:2023-07-23 ,文章wp主题 文章页面调用当前主分类下所有子分类名主要讲述名称,页面,网站搭建网站建设源码以及服务器配置搭建相关技术文章。转载请保留链接: http://www.tngdez.cn/article/web_34936.html