所有類別
的列表中添加下面的代碼在你的模板
<style type="text/css">
.single-product div.product .product_meta .product_cat ul li{ list-style-type:circle;}
.single-product div.product .product_meta .product_cat ul li.current-cat{list-style-type:circle;}
.single-product div.product .product_meta .product_cat ul li.current-cat a{display: inline-block;font-weight:bold;}
</style>
<?php
global $post;
$terms = get_the_terms($post->ID, 'product_cat');
$product_cat_id_array = array();
foreach ($terms as $term ) {
$product_cat_id_array[] = $term->term_id;
}
$product_cat_id_string = implode(",",$product_cat_id_array);
$args = array(
'child_of' => 0,
'current_category' => $product_cat_id_string,
'depth' => 0,
'echo' => 1,
'exclude' => '',
'exclude_tree' => '',
'feed' => '',
'feed_image' => '',
'feed_type' => '',
'hide_empty' => 0,
'hide_title_if_empty' => false,
'hierarchical' => true,
'order' => 'ASC',
'orderby' => 'name',
'separator' => '',
'show_count' => 0,
'show_option_all' => '',
'show_option_none' => __('No categories'),
'style' => 'list',
'taxonomy' => 'product_cat',
'title_li' => __('Categories'),
'use_desc_for_title' => 0,
);
wp_list_categories($args);
?>
也請分享您的代碼。所以我們可以給出答案。 –
@ShitalMarakana你得到它 – Santiago