Last active
February 17, 2021 00:23
-
-
Save frankyonnetti/bceabc1555d5de9fea1f7f678d560ea3 to your computer and use it in GitHub Desktop.
WordPress - get_categories #wordpress #categories #terms
This file contains hidden or 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
| $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