Problem creating custom menus for different category pages
-
I am currently developing a website for someone and I am having some issues with getting different menus to only show up on certain category pages. (e.g menu 1 on the about page, and menu 2 on the contact page and if the category isnt mentioned to not show a menu).
I have tried searching for solutions and experimenting with the code but since my php knowledge is limited I am still having trouble. I think there is something wrong with my if/else statements.
My code is –
<?php if (is_category(‘currentlyavailable’||’image-gallery’||’about’||’map’||’contact’)): ?>
Currently Available<div id=”firstpane” class=”menu_list”>
<p class=”menu_head”>MtR</p>
<div class=”menu_body”>
<?php wp_nav_menu( array(‘menu’ => ‘MR’ )); ?>
</div>
<p class=”menu_head”>AtF</p>
<div class=”menu_body”>
<?php wp_nav_menu( array(‘menu’ => ‘AF’ )); ?>
</div>
<p class=”menu_head”>MtC</p>
<div class=”menu_body”>
<?php wp_nav_menu( array(‘menu’ => ‘MC’ )); ?>
</div>
<p class=”menu_head”>FtC</p>
<div class=”menu_body”>
<?php wp_nav_menu( array(‘menu’ => ‘FC’ )); ?>
</div>
</div><?php elseif (is_category(‘how-to-care’||’walkingdd’)): ?>
Choosing a Walk<div id=”firstpane” class=”menu_list”>
<p class=”menu_head”>WF</p>
<div class=”menu_body”>
<?php wp_nav_menu( array(‘menu’ => ‘WhF’ )); ?>
</div>
<p class=”menu_head”>ST</p>
<div class=”menu_body”>
<?php wp_nav_menu( array(‘menu’ => ‘SIAT’ )); ?>
</div>
</div><?php elseif (is_category(‘comingsoon’)): ?>
CS<div id=”firstpane” class=”menu_list”>
<p class=”menu_head”>CSJ</p>
<div class=”menu_body”>
<?php wp_nav_menu( array(‘menu’ => ‘TCDSJ’ )); ?>
</div>
</div><?php endif; ?>
Right now the first menu ‘currently available’ is the only one showing, and comes up on all of the category pages except the homepage. If anyone is able to help with this I would really appreciate it.
- The topic ‘Problem creating custom menus for different category pages’ is closed to new replies.