Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#20922 closed defect (bug) (fixed)

Twenty Eleven hides category and tag text on custom post types being included into loop using 'pre_get_posts' action

Reported by: marko-m's profile Marko-M Owned by: lancewillett's profile lancewillett
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.2
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

Twenty Eleven themes custom.php uses 'post' == get_post_type() to hide category and tag text for pages on Search like this:

<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
...
<?php endif; // End if 'post' == get_post_type() ?>

This 'if' doesn't hide category and tag text for pages on Search but hides category and tag text on custom post types being included into loop using 'pre_get_posts' action.

Attachments (1)

20922.diff (1.5 KB) - added by obenland 12 years ago.

Download all attachments as: .zip

Change History (7)

#1 @nacin
12 years ago

  • Component changed from General to Bundled Theme
  • Version changed from 3.3.2 to 3.2

What we should probably use instead is is_object_in_taxonomy( get_post_type(), 'post_tag' ) and 'category'.

#2 @knutsp
12 years ago

  • Cc knut@… added

#3 @Mamaduka
12 years ago

  • Cc georgemamadashvili@… added

@obenland
12 years ago

#4 @obenland
12 years ago

  • Keywords has-patch added

In 20922.diff: Show categories and tags only when supported by post type.

#5 @lancewillett
12 years ago

  • Owner set to lancewillett
  • Resolution set to fixed
  • Status changed from new to closed

In [22193]:

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.

#6 @lancewillett
12 years ago

  • Milestone changed from Awaiting Review to 3.5
Note: See TracTickets for help on using tickets.