小编Ant*_*eld的帖子

与 WooCommerce 中当前产品相关的产品类别链接术语列表

我在网上找到了一段代码,目前列出了这个 WooCommerce 网站上的所有类别。

如何使其具体显示与他们正在查看的产品相关的类别?

这是我调整过的代码:

<div id="ListCat">                  
<h3>Listed in the following categories<?php the_category(); ?></h3>
<?php
$taxonomy     = 'product_cat';
$orderby      = 'name';  
$show_count   = 0;      // 1 for yes, 0 for no
$pad_counts   = 0;      // 1 for yes, 0 for no
$hierarchical = 0;      // 1 for yes, 0 for no  
$title        = '';  
$empty        = 0;

$args = array(
     'taxonomy'     => $taxonomy,
     'orderby'      => $orderby,
     'show_count'   => $show_count,
     'pad_counts'   => $pad_counts,
     'hierarchical' => $hierarchical,
     'title_li'     => $title,
     'hide_empty'   => …
Run Code Online (Sandbox Code Playgroud)

php wordpress product categories woocommerce

0
推荐指数
1
解决办法
7789
查看次数

标签 统计

categories ×1

php ×1

product ×1

woocommerce ×1

wordpress ×1