Created
October 19, 2021 07:42
-
-
Save vicso-name/3d38db6773ccc5c18027b06d0711eb5c to your computer and use it in GitHub Desktop.
How to get terms title and link to the term. This method also works for custom taxonomy.
This file contains 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
<?php | |
$terms = get_the_terms( $current_post_id, 'products' ); | |
foreach($terms as $term) { | |
$term_title = $term->name; | |
$term_link = get_term_link($term); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment