WordPress.org

Make WordPress Core

Opened 22 months ago

Closed 18 months ago

Last modified 18 months 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 Owned by: 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 20 months ago.

Download all attachments as: .zip

Change History (7)

comment:1 nacin22 months 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'.

comment:2 knutsp22 months ago

  • Cc knut@… added

comment:3 Mamaduka21 months ago

  • Cc georgemamadashvili@… added

obenland20 months ago

comment:4 obenland20 months ago

  • Keywords has-patch added

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

comment:5 lancewillett18 months 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.

comment:6 lancewillett18 months ago

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