How to set dynamic body IDs/classes in WordPress

May 28, 2009 | Leave a Comment

Perishable Press lists 9 different ways you can “label” your <body> element using PHP and WordPress—very useful for development themes with special features depending on where you are in a WP site. A lot of them are derived from theme development experts and popular theme frameworks like the WordPress Sandbox.

The 9th way must be mentioned here: when WordPress 2.8 comes out, things will become much easier since it now has the body_class() function. More info about that here (since there’s no page on the Codex for it yet).

Share This Blog Post

  • email
  • Twitter
  • Tumblr
  • FriendFeed
  • Facebook
  • Digg
  • del.icio.us
  • Blogosphere News
  • StumbleUpon
  • Google Bookmarks
  • Ping.fm
  • HelloTxt
  • Mixx

Related Posts

Tags: , , ,

Leave a Reply

CommentLuv Enabled
Download WordPress
WordPress Philippines
  • China Wholesale