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: http://core.svn.wordpress.org/trunk@22193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2012-10-11 19:53:35 +00:00
parent da8d7a347a
commit bbfab9b4cb

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 ) : ?>