Skip to content

Instantly share code, notes, and snippets.

@qwersk
Created June 16, 2017 04:04
Show Gist options
  • Select an option

  • Save qwersk/bd4be42b5a2874c22925c52c04438f17 to your computer and use it in GitHub Desktop.

Select an option

Save qwersk/bd4be42b5a2874c22925c52c04438f17 to your computer and use it in GitHub Desktop.
GET SUBCATERY
// 163 - necessary category id
// "category" - taxonomy name
$children_id = get_term_children(163, "category");
foreach($children_id as $child){
$term = get_term_by("id", $child, "category");
$id = $term->term_id;
$name = $term->name;
$count = $term->count;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment