Title: Double Conditional Statement
Last modified: August 19, 2016

---

# Double Conditional Statement

 *  Resolved [drinkingsouls](https://wordpress.org/support/users/drinkingsouls/)
 * (@drinkingsouls)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/double-conditional-statement/)
 * Hey guys,
    I’m using conditional statements in my theme. I’m trying to check 
   if it is not a home page or a single post.
 * `if (!is_home())` Works great to say if it is not the home page.
 * I tried `if (!is_home() || !is_single())` but I can’t get that to work. I need
   to say if it is not the home page or a single post.
    Any ideas? Any help is appreciated.
   Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Curtiss Grymala](https://wordpress.org/support/users/cgrymala/)
 * (@cgrymala)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/double-conditional-statement/#post-1914041)
 * You want to use:
    `if ( !is_home() && !is_single() )`
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/double-conditional-statement/#post-1914042)
 * the “!” part means “not”.
    so try this: `if (!is_home() || is_single())` This
   means: if it’s not the home page or if it’s a single post.
 *  [xGEcoder](https://wordpress.org/support/users/xgecoder/)
 * (@xgecoder)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/double-conditional-statement/#post-1914045)
 * Memories of my college logic course!
    Are you testing that it is not a home page
   and it is not a single post? The coding becomes clearer when you first word it
   that way. Being a newcomer to WP, templates, html and PHP I don’t know those 
   coding conventions but that’s how I approached that logic in earlier languages.
 *  Thread Starter [drinkingsouls](https://wordpress.org/support/users/drinkingsouls/)
 * (@drinkingsouls)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/double-conditional-statement/#post-1914046)
 * Thanks a ton Curtiss Grymala, that was it.
    Just to clear it up, yes I’m testing
   that it is not the home page and not a single post. The code that worked it: `
   if ( !is_home() && !is_single() )`

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Double Conditional Statement’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 4 participants
 * Last reply from: [drinkingsouls](https://wordpress.org/support/users/drinkingsouls/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/double-conditional-statement/#post-1914046)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
