Make WordPress Core

Changeset 22193


Ignore:
Timestamp:
10/11/2012 07:53:35 PM (12 years ago)
Author:
lancewillett
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyeleven/content.php

    r21368 r22193  
    4646        <footer class="entry-meta">
    4747            <?php $show_sep = false; ?>
    48             <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
     48            <?php if ( is_object_in_taxonomy( get_post_type(), 'category' ) ) : // Hide category text when not supported ?>
    4949            <?php
    5050                /* translators: used between list items, there is a space after the comma */
     
    5757            </span>
    5858            <?php endif; // End if categories ?>
     59            <?php endif; // End if is_object_in_taxonomy( get_post_type(), 'category' ) ?>
     60            <?php if ( is_object_in_taxonomy( get_post_type(), 'post_tag' ) ) : // Hide tag text when not supported ?>
    5961            <?php
    6062                /* translators: used between list items, there is a space after the comma */
     
    6971            </span>
    7072            <?php endif; // End if $tags_list ?>
    71             <?php endif; // End if 'post' == get_post_type() ?>
     73            <?php endif; // End if is_object_in_taxonomy( get_post_type(), 'post_tag' ) ?>
    7274
    7375            <?php if ( comments_open() ) : ?>
Note: See TracChangeset for help on using the changeset viewer.