DiggingIntoWordPress

by Chris Coyier & Jeff Starr

Tag: functions

Advanced WordPress Targeting with body_class_plus()

Posted by on

Since WordPress 2.8, we can target specific types of page views with CSS using the new body_class() tag. Designed for use within the <body></body> element, body_class() outputs various class attributes according to the current type of page view. This makes it easy to apply page-specific styling such as current-page navigation highlighting and other nifty CSS tricks.

Code is poetry