Like the blog? Get the book »

Posts tagged: body

Archive page 1 of 1
Advanced WordPress Targeting with body_class_plus()

Advanced WordPress Targeting with body_class_plus()

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.

Unique Body ID’s for your Pages

Unique Body ID’s for your Pages

There are many reasons you might want to get a unique ID for your <body></body> tag. Let’s say you want your header elements to be a different color on your About page, you could apply a bit of CSS via your theme’s stylesheet (i.e., style.css). For example, you could target the About page with some styles something like this:

© 2009–2024 Digging Into WordPress Powered by WordPress Monzilla Media shapeSpace