Skip to content

Instantly share code, notes, and snippets.

@frankyonnetti
Last active February 17, 2021 00:23
Show Gist options
  • Select an option

  • Save frankyonnetti/bceabc1555d5de9fea1f7f678d560ea3 to your computer and use it in GitHub Desktop.

Select an option

Save frankyonnetti/bceabc1555d5de9fea1f7f678d560ea3 to your computer and use it in GitHub Desktop.
WordPress - get_categories #wordpress #categories #terms
$taxonomy = 'concerts';
$queried_term = get_query_var($taxonomy);
$terms = get_terms($taxonomy, 'slug='.$queried_term);
if ($terms) {
echo '<ul>';
foreach($terms as $term) {
echo '<li><a href="'.get_term_link($term->slug, $taxonomy).'">'.$term->name.'</a></li>';
}
echo '</ul>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment