WooCommerce: Elenca tutte le categorie
1 risposta
- voti
tratto dalla stessafunzione:
// prior to wordpress 4.5.0
$args = array(
'number' => $number,
'orderby' => $orderby,
'order' => $order,
'hide_empty' => $hide_empty,
'include' => $ids
);
$product_categories = get_terms( 'product_cat', $args );
// since wordpress 4.5.0
$args = array(
'taxonomy' => "product_cat",
'number' => $number,
'orderby' => $orderby,
'order' => $order,
'hide_empty' => $hide_empty,
'include' => $ids
);
$product_categories = get_terms($args);
ti fornirà l'elenco delle categorie diprodotti.facile!
taken from that very same function:
// prior to wordpress 4.5.0
$args = array(
'number' => $number,
'orderby' => $orderby,
'order' => $order,
'hide_empty' => $hide_empty,
'include' => $ids
);
$product_categories = get_terms( 'product_cat', $args );
// since wordpress 4.5.0
$args = array(
'taxonomy' => "product_cat",
'number' => $number,
'orderby' => $orderby,
'order' => $order,
'hide_empty' => $hide_empty,
'include' => $ids
);
$product_categories = get_terms($args);
will give you the list of product categories. easy!
Sto utilizzandoilplugin WooCommerce con WordPresse nelmiotema vorreielencaretutte le categorie all'interno di unmenu dinavigazione con PHP.
Hoprovato a utilizzare
woocommerce_product_categories();
manon voglio leimmagini o altrielementi HTML,soloi loronomi (eforsei permalink).
Comeposso ottenere quei dati?