0
目前即時通訊使用這種顯示代碼顯示產品分類Woocommerce/PHP
<?php
$args = array(
'number' => 100,
'orderby' => 'title',
'order' => 'ASC',
'hide_empty' => false
);
$product_categories = get_terms('product_cat', $args);
$count = count($product_categories);
if ($count > 0) {
foreach($product_categories as $product_category) {
$cat_thumb_id = get_woocommerce_term_meta($product_category - > term_id,'thumbnail_id', true);
$cat_thumb_url = wp_get_attachment_thumb_url($cat_thumb_id);
$term_link = get_term_link($product_category, 'product_cat');
echo '<a href="'.$term_link.'"><img src="'.$cat_thumb_url.'"/></a>';
echo '<h4><a href="'.get_term_link($product_category).'">'.$product_category - > name.'</a></h4>';
}
}
?>
,但我想發展這個代碼顯示基於產品標籤的產品類別是有辦法做到這個 ?