Last active
August 29, 2015 13:58
-
-
Save aaronranard/9958873 to your computer and use it in GitHub Desktop.
WordPress - get custom taxonomies for post
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
$categories = get_the_terms( get_the_id() , 'service' ); | |
$separator = '<br />'; | |
$output = ''; | |
if($categories){ | |
foreach($categories as $category) { | |
//$output .= '<a href="'.get_category_link( $category->term_id ).'" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '">'.$category->cat_name.'</a>'.$separator; | |
$output .= $category->name . $separator; | |
} | |
echo trim($output, $separator); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment