Coding for multiple custom sidebars (elseif)
-
I have a custom sidebar called when a post (single.php) is from a specific category. It’s set up like this…
<?php global $post; $side = false; foreach( (get_the_category($post->ID)) as $category) { if ($category->cat_ID == 168) {$side = true;}; } if($side) { include(TEMPLATEPATH."/sidebar_custom.php"); } else { include(TEMPLATEPATH."/sidebar.php"); } ?>
Now I want to add another custom sidebar. I think I need an elseif statement, but I’m not quite sure of the syntax and where to insert it. Can anyone help?
Viewing 15 replies - 1 through 15 (of 15 total)
Viewing 15 replies - 1 through 15 (of 15 total)
- The topic ‘Coding for multiple custom sidebars (elseif)’ is closed to new replies.