How to add extra classes to Wordpress's body element?

PCDiver

New Member
In the default Wordpress template, there is this in \[code\]header.php\[/code\].\[code\]<body <?php body_class(); ?>>\[/code\]This echos some useful hooks for CSS and JavaScript. Some example output is\[code\]<body class="page page-id-45 page-template page-template-gallery-php">\[/code\]Is it possible, within the \[code\]header.php\[/code\] even, to add my own classes in addition to what is there?Specifically, I'd like to do a quick \[code\]strstr\[/code\] on \[code\]$_SERVER['HTTP_USER_AGENT']\[/code\] and add a class if the device is an iDevice.I figure I could do it with JavaScript, but still being able to know how to add my own classes would be useful nevertheless.
 
Back
Top