is not in category
-
Hi.
Getting a bit mixed up with my conditional statements.
I need to change the body class if it is a category/archive page. but if the category is Reviews or Opinions, it needs to be a slightly different class.
<?php if (is_home()) { echo '<body class="page-home">'; } elseif (is_search()) { echo '<body class="page-search">'; } elseif (is_category('Reviews')) { echo '<body class="page-reviews">'; } elseif (is_category('Opinion')) { echo '<body class="page-opinion">'; } elseif (is_category()) { echo '<body class="page-archive">'; } elseif (is_single()) { if (in_category('Reviews')) { echo '<body class="page-reviews">'; } elseif (in_category('Opinion')) { echo '<body class="page-opinion">'; } else { echo '<body class="page-site">'; } } else { echo '<body class="page-site">'; } ?>
must be getting something mixed up there. Help please! ??
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘is not in category’ is closed to new replies.