Created
November 15, 2013 12:34
-
-
Save CEscorcio/7483659 to your computer and use it in GitHub Desktop.
LIst all categories in wooCommerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sir where to paste this code