Skip to content

Instantly share code, notes, and snippets.

@CEscorcio
Created November 15, 2013 12:34
Show Gist options
  • Save CEscorcio/7483659 to your computer and use it in GitHub Desktop.
Save CEscorcio/7483659 to your computer and use it in GitHub Desktop.
LIst all categories in wooCommerce
<?php
$args = array( 'taxonomy' => 'product_cat' );
$terms = get_terms('product_cat', $args);
$count = count($terms); $i=0;
if ($count > 0) {
foreach ($terms as $term) {
$i++;
$term_list .= '<li><a href="/categoria/' . $term->slug . '" title="' . sprintf(__('View all post filed under %s', 'my_localization_domain'), $term->name) . '">' . $term->name . '</a></li>';
}
echo $term_list;
}
?>
@aravkumar25
Copy link

sir where to paste this code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment