Created
October 25, 2012 08:24
-
-
Save mfields/3951401 to your computer and use it in GitHub Desktop.
WordPress: Echoing categories and tags independent of post_type.
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 | |
if ( is_object_in_taxonomy( get_post_type(), 'post_tag' ) ) { | |
/* translators: used between list items, there is a space after the comma. */ | |
$tag_list = get_the_tag_list( '', __( ', ', '_s' ) ); | |
if ( $tag_list && _s_categorized_blog() ) | |
echo '<span class="entry-tags">' . $tag_list . '</span>'; | |
} | |
if ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { | |
/* translators: used between list items, there is a space after the comma. */ | |
$category_list = get_the_category_list( __( ', ', '_s' ) ); | |
if ( $category_list && _s_categorized_blog() ) | |
echo '<span class="entry-categories">' . $category_list . '</span>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment