I want to add a class to the body tag to all pages EXCEPT the homepage. Right now I have.
<?php body_class('interior'); ?>
But it adds ‘interior’ to ALL pages including the home page.
What is the best standard way of adding a class to the body tag?
3 Answers
Try it:
<?php
$class = ! is_home() ? "interior" : "";
body_class( $class );
?>
Or this:
<?php
body_class( ! is_home() ? "interior" : "" );
?>