Last active
December 3, 2018 18:09
-
-
Save sitebuilderone/b8e2b7a02903ed1677ea9532e99248b8 to your computer and use it in GitHub Desktop.
Custom post types (CPT) snippets
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
// display category terms for CPT3 | |
$terms = get_the_terms( $post->ID , 'website_tools_category' ); | |
foreach ( $terms as $term ) { | |
$term_link = get_term_link( $term, 'website_tools_category' ); | |
if( is_wp_error( $term_link ) ) | |
continue; | |
echo '<a href="' . $term_link . '">' . $term->name . '</a>'; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment