外贸建站资讯分享

wordpress分类页面调用一级分类以及一级分类下的二级分类和分类图

阅读数:2745 时间:30/04/2022 来源:解决方案技术分享 标签:

您所在的位置:

<?php
$args=array(
‘child_of’=> $catid01,
‘parent’ => $catid01,
‘hide_empty’=>’0’,
);
$categories=get_categories($args);
foreach($categories as $category) {?>
<p class=”con_p1″><a href=”<?php%20echo%20get_category_link(%20$category->term_id%20)%20;?>” title=”‘ . $category->name.'”><?php echo $category->name;?></a></p>
<ul>
<?php
$argszi=array(
‘child_of’=> $category->term_id,
‘parent’ => $category->term_id,
‘hide_empty’=>’0’,
);
$categorieszi=get_categories($argszi);
foreach($categorieszi as $categoryzi) {?>
<a href=”<?php%20echo%20get_category_link(%20$categoryzi->term_id%20)%20;?>” title=”<?php echo $categoryzi->name;?>”>
<img src=”<?php%20echo%20z_taxonomy_image_url($categoryzi->term_id);%20?>” alt=”<?php echo get_cat_name($categoryzi->term_id); ?>” class=”home-img”>
<div class=”navcaption”><?php echo $categoryzi->name;?></div>
</a>
<?php }
?>
</ul>
<?php }
?>


关闭

网站需求

    您的公司*

    您的姓名*

    您的手机*

    您的需求