Skip to content

Instantly share code, notes, and snippets.

@nicksatkovich
Created April 1, 2013 19:53
Show Gist options
  • Select an option

  • Save nicksatkovich/5287253 to your computer and use it in GitHub Desktop.

Select an option

Save nicksatkovich/5287253 to your computer and use it in GitHub Desktop.
<?php
$args = array( 'taxonomy' => 'product_cat', 'child_of' => 16, 'exclude_tree' => 15 );
$terms = get_terms('product_cat', $args);
$count = count($terms); $i=0;
if ($count > 0) {
//$cape_list = '<p class="my_term-archive">';
foreach ($terms as $term) {
$i++;
$term_list .= '<li><a href="/shop/product-category/' . $term->slug . '/" title="' . sprintf(__('View all products filed under %s', 'my_localization_domain'), $term->name) . '">' . $term->name . '</a></li>';
//if ($count != $i) $term_list .= ' &middot; '; else $term_list .= '</p>';
}
echo $term_list;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment