Title: Conditional Menu for Posts Within Category
Last modified: August 22, 2016

---

# Conditional Menu for Posts Within Category

 *  [pinkhairedpixel](https://wordpress.org/support/users/pinkhairedpixel/)
 * (@pinkhairedpixel)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/conditional-menu-for-posts-within-category/)
 * Hi,
 * I need to display a different menu for a certain category AND posts within that
   category. I have been looking for a code or plugin (although I would rather use
   code) and can’t seem to find something that will display the new primary nav 
   for posts within the category, only the category page itself. I tried this code
   and it did nothing.
 *     ```
       <?php
       if(has_nav_menu('primary'))
       {
       }
          if(is_category(meijer-2)){
           $locationMenu=meijer
       ?>
       <?php
                       wp_nav_menu( array(
       			'menu' => $locationMenu,
                               'theme_location'=> 'primary',
                               'container'     => false,
                               'menu_id'       => 'nav',
                               'fallback_cb'   => 'wp_page_menu'
                           ) );
       } else
       ?>
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [pinkhairedpixel](https://wordpress.org/support/users/pinkhairedpixel/)
 * (@pinkhairedpixel)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/conditional-menu-for-posts-within-category/#post-5204721)
 * bump anyone?

Viewing 1 replies (of 1 total)

The topic ‘Conditional Menu for Posts Within Category’ is closed to new replies.

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [conditional menu](https://wordpress.org/support/topic-tag/conditional-menu/)
 * [menu](https://wordpress.org/support/topic-tag/menu/)
 * [primary navigation](https://wordpress.org/support/topic-tag/primary-navigation/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [pinkhairedpixel](https://wordpress.org/support/users/pinkhairedpixel/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/conditional-menu-for-posts-within-category/#post-5204721)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
