Created
September 25, 2018 11:33
-
-
Save nfsarmento/e437f7b74b0ffd63046eec1cfd8efa6d to your computer and use it in GitHub Desktop.
Get category title with url
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
<h5 class="category-title"> | |
<?php | |
$terms = get_the_terms( $post->ID , 'sector' ); | |
foreach ( $terms as $term ) { | |
echo ' <a href="' .esc_url( home_url( '/' ) ). $term->slug . '" title="' . $term->name . '" ' . '>' . $term->name .'</a> '; | |
} | |
?> | |
</h5> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment