Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#15017 closed defect (bug) (fixed)

get_body_class() doesn't return information about the current custom taxonomy archive

Reported by: nkuttler's profile nkuttler Owned by: nkuttler's profile nkuttler
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch, ui-feedback
Focuses: Cc:


Custom taxonomy archives don't get a body class added. Patch attached.

Attachments (4)

body_class_tax.diff (619 bytes) - added by nkuttler 14 years ago.
Trivial patch
body_class_tax2.diff (665 bytes) - added by nkuttler 14 years ago.
body_class_tax2.2.diff (656 bytes) - added by nkuttler 14 years ago.
body_class_tax.trunk.diff (684 bytes) - added by nkuttler 14 years ago.

Download all attachments as: .zip

Change History (12)

14 years ago

Trivial patch

#1 @nkuttler
14 years ago

The first patch was flawed. The second one adds

tax-$taxonomy and

which makes this usable.

#2 @hakre
14 years ago

why not <body class="... tax-$taxonomy term-$term ...">?

that would save the $taxonomy duplication and both can be combined in css selectors by concatenation ($taxonomy.term-$term). Additionally, from a styling perspective the same term can be addressed across taxonomies

#3 @nkuttler
14 years ago

Sounds perfect. tax-$taxonomy-$term is cumbersome indeed.

#4 @nkuttler
14 years ago

  • Keywords ui-feedback added

#5 @nkuttler
14 years ago

  • Owner set to nkuttler
  • Status changed from new to accepted

#6 @dd32
14 years ago

Would it be worth sanitizing the taxonomy name as well?

#7 @nkuttler
14 years ago

Indeed, and I've cleanup up the patch a bit.

#8 @nacin
14 years ago

  • Milestone changed from Awaiting Review to 3.1
  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.