term_id; $termid = get_term($term, 'product_cat' ); if($termid->parent > 0) { $args = array( 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => false, 'child_of' => $termid->parent, ); $siblingproducts = get_terms( 'product_cat', $args); foreach ($siblingproducts as $siblingproduct) { if ($siblingproduct->term_id == $term ) { echo '
  • '; } else { echo '
  • '; } echo ''; echo $siblingproduct->name; echo '
  • '; } } else { $args = array( 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => false, 'parent' => $term ); $subproducts = get_terms( 'product_cat', $args); foreach ($subproducts as $subproduct) { echo '
  • '; echo $subproduct->name; echo '
  • '; } } ?>