Title: Dynamic Menu Question
Last modified: August 19, 2016

---

# Dynamic Menu Question

 *  [britneyjackson](https://wordpress.org/support/users/britneyjackson/)
 * (@britneyjackson)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/dynamic-menu-question/)
 * Morning,
 * I wondered if anyone was able to offer me some advice. I am trying to create 
   a dynamic menu (see below) but I am running into a problem, the code below highlights‘
   News’ if on single.php, archive & archive-2 pages.
 * `<li <?php if ( is_page("archive") || (is_page("archive-2") || (is_single()))){
   echo 'class="current_page_item"';} ?>><a href="<?php bloginfo('url'); ?>/archive/"
   >News</a></li>`
 * Now I want to create another menu item for ‘gig’ using the code below, but because
   the category post uses single.php it highlights the menu as ‘news’ because single.
   php is used in the ‘news’ menu item. Is there a way to trick WP into showing ‘
   gigs’ highlighted instead of ‘news’ when viewing a category post using single.
   php?
 *     ```
       <li <?php if ( is_category("9") || (is_page("gigs"))) { echo 'class="current_page_item"';} ?>><a href="<?php bloginfo('url'); ?>/gigs/">Gigs</a></li>
       ```
   
 * Many thanks for any assistance you can offer 🙂

The topic ‘Dynamic Menu Question’ is closed to new replies.

## Tags

 * [single.php](https://wordpress.org/support/topic-tag/single-php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [britneyjackson](https://wordpress.org/support/users/britneyjackson/)
 * Last activity: [17 years, 11 months ago](https://wordpress.org/support/topic/dynamic-menu-question/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
