Title: Conditional Inside Conditional
Last modified: August 19, 2016

---

# Conditional Inside Conditional

 *  Resolved [greasypigstudios](https://wordpress.org/support/users/greasypigstudios/)
 * (@greasypigstudios)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/conditional-inside-conditional/)
 * What’s the proper way to do a conditional inside another conditional?
 * Something like (syntax simplified):
 *     ```
       If is_page(1,2) { list titles of page 1 and 2:
                if is_page(1) { name of page 1 in black } else {name in white}
                if is_page(2) { name of page 2 in black } else {name in white}
                }
       elseif is_page(3,4,5) {list titles of page 3 and 4:
                if is_page(3) { name of page 3 in black } else {name in white}
                if is_page(4) { name of page 4 in black } else {name in white}
                if is_page(5) { name of page 5 in black } else {name in white}
                }
       ```
   
 * Basically I need a sidebar link list in two variations, one for page 1/2 and 
   one for page 3/4, and each styled differently.
 * But I also need it so that the page you’re currently on is a different color 
   from the other links in its respective list.
 * Any novel approaches is much appreciated.

Viewing 1 replies (of 1 total)

 *  Thread Starter [greasypigstudios](https://wordpress.org/support/users/greasypigstudios/)
 * (@greasypigstudios)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/conditional-inside-conditional/#post-1232331)
 * Oops, I fixed it, the error I was getting was due to a missing parenthesis.

Viewing 1 replies (of 1 total)

The topic ‘Conditional Inside Conditional’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [greasypigstudios](https://wordpress.org/support/users/greasypigstudios/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/conditional-inside-conditional/#post-1232331)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
