WordPress 2.8+ gave us a new set of classes for the tag. 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(); } ?>>
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 2.8.1+ 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



Thank you Phil. This is just way too cool. I could already do a lot of styling with the new body classes alone and now this. Thank you for sharing.