elseif statements limited to two?
-
I am trying to code my category.php page so each category (or related categories) displays different custom subnavigation. My code follows:
<?php if (is_category(‘locations’)) {
echo “
<div id=’subnavigation’ class=’nine’>-
<li id=’covington’>Covington
<li id=’federal-way’>Federal Way
<li id=’lacey’>Lacey
<li id=’lake-tapps’>Lake Tapps
<li id=’lynnwood’>Lynnwood
<li id=’mill-creek’> Mill Creek
<li id=’puyallup’>Puyallup
<li id=’tacoma’>Tacoma
<li id=’vancouver’>Vancouver</div>”;
} elseif (is_category(‘menu’||’pizza’||’appetizers’||’soups-salads’||’burgers’||’sandwiches-wraps’||’chicken’||’pasta’||’calzones’||’rocktails’||’microbrews’)) {
echo”
<div id=’subnavigation’ class=’ten’>-
<li id=’pizza’>Pizza
<li id=’appetizers’> Appetizers
<li id=’soups-salads’>Soups & Salads
<li id=’burgers’> Burgers
<li id=’sandwiches-wraps’> >Sandwiches & Wraps
<li id=’chicken’> Chicken
<li id=’pasta’> Pasta
<li id=’calzones’> Calzones
<li id=’rocktails’> Rocktails
<li id=’microbrews’>Microbrews</div>”;
} elseif (is_category(‘about-the-rock’)) {
echo”
<div id=’subnavigation’ class=’two’>-
<li id=’covington’>Covington
<li id=’federal-way’Federal Way</div>”;
}else {
echo”<div id=’subnavigation’ class=’two’>-
<li id=’covington’> Covington
<li id=’federal-way’> Federal Way</div>”;
}?>The problem I’m having is that only the first two subnavigations will display at all. It’s as if the remaining elseif statements are being ignored.
The staged site can be viewed here: https://www.therockwfp.com/wordpress
Any suggestions will be appreciated.
- The topic ‘elseif statements limited to two?’ is closed to new replies.