Twenty Eleven: show categories and tags only when supported by post type, using `is_object_in_taxonomy()` instead of only checking for 'post' post types. Props obenland, fixes #20922.

git-svn-id: https://develop.svn.wordpress.org/trunk@22193 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Lance Willett 2012-10-11 19:53:35 +00:00
parent 167cc00a84
commit 51a14e8247
1 changed files with 4 additions and 2 deletions

View File

@ -45,7 +45,7 @@
<footer class="entry-meta">
<?php $show_sep = false; ?>
<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
<?php if ( is_object_in_taxonomy( get_post_type(), 'category' ) ) : // Hide category text when not supported ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
@ -56,6 +56,8 @@
$show_sep = true; ?>
</span>
<?php endif; // End if categories ?>
<?php endif; // End if is_object_in_taxonomy( get_post_type(), 'category' ) ?>
<?php if ( is_object_in_taxonomy( get_post_type(), 'post_tag' ) ) : // Hide tag text when not supported ?>
<?php
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
@ -68,7 +70,7 @@
$show_sep = true; ?>
</span>
<?php endif; // End if $tags_list ?>
<?php endif; // End if 'post' == get_post_type() ?>
<?php endif; // End if is_object_in_taxonomy( get_post_type(), 'post_tag' ) ?>
<?php if ( comments_open() ) : ?>
<?php if ( $show_sep ) : ?>