WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#10333 closed defect (bug) (fixed)

Pages in Search results with the_category() shows default category

Reported by: pavelevap Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: Template Keywords: needs-patch
Focuses: Cc:

Description

When using the_category() in Search results (search.php) in template, pages are shown with default category. That is nonsense, no category should be displayed. Tested with default theme, only search for something which contains default page, then you will see results with this page in category: Uncategorized.

Change History (4)

comment:1 pavelevap5 years ago

  • Cc pavelevap@… added

comment:2 ryan4 years ago

  • Milestone changed from 2.9 to 3.0

comment:3 nacin4 years ago

  • Keywords needs-patch added

This has new implications in 3.0. Some well-placed is_object_in_taxonomy() checks should do the trick.

comment:4 markjaquith4 years ago

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

(In [14660]) Do not show dummy default category output when calling the_category on a post_type that does not support the category taxonomy (like pages). Fix TwentyTen theme to not display wrapping text if there are no categories. fixes #10333

Note: See TracTickets for help on using tickets.