WordPress 2.8+ gave us a a lot of new sets of classes for the body post and comment areas. That will allow designers to use those tags in designing their site. These tags are ‘dynamically generated’ when certain events or pages are loaded. To enable your theme to use those tags you just have to do a little editing to your theme.

<body <?php if (function_exists('body_class')) { body_class(); } >>

On Frumph.NET and other WordPress / ComicPress sites, there’s a plethora of different customizations you can do. Per page, per category, if the page is in the comic category and more. In example on this site for this page if you were to go to page 2 of this post.

<body class="single single-post postid-220 logged-in paged-2 single-paged-2 user-admin sitemember noncomic gecko single-category-wordpress single-author-admin am day morning tue layout-3c">

All of these can be used to design your site by just placing one of those before the element you want to use.

This says, if the function exists, body_class then go ahead and run that function. Using function_exists allows WordPress installations that do not have that function installed to basically bypass running that function if it’s not available.

In ComicPress versions 2.8 and higher, I have included a function that extends the abilities of the body_class function giving even more dynamically generated tags.

The Extended Body Classes

User Classes
.user-userloginname
.user-guest
.sitemember
.non-sitemember

Browser Classes
.lynx
.gecko
.opera
.ns4
.safari
.chrome
.ie
.unknown
.iphone

Body Post Classes (Index/Home Page)
.sticky-post

Body Post Classes (Single Page)
.single-category-thecategorynamethepostisin
.single-author-theauthorofthepost

Time of Day Classes
.am
.pm
.midnight – 11:30pm to 12:30am
.night – 12:30am to 6am
.morning – 6am to 11:30am
.noon – 11:30am to 12:30pm
.day – 12:30pm to 6pm
.evening – 6pm to 11:30pm

Attachment Classes
.attachment
.attachment-ID# – The ID# of the attachment in the post
.attachment-type – The type of attachment it is

Layout Classes
.layout-standard
.layout-3c
.layout-gn
.layout-v
.layout-v3c

Next Page, The Extended Body Class Function