Title: Conditional statement for two conditions
Last modified: August 19, 2016

---

# Conditional statement for two conditions

 *  Resolved [rezag](https://wordpress.org/support/users/rezag/)
 * (@rezag)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/conditional-statement-for-two-conditions/)
 * I need to create a conditional to show a different header. I have seen and used
   conditionals before but can’t get this to work.
 * I want the header to be displayed for a category (let’s say category 5) archive
   page _and_ the same header when single posts of that same category are displayed.
   I guess I don’t know how to do this and/or logic, any help is appreciated.
 * (off topic: years ago I had this same user name but my old password didn’t work,
   I am surprised I was just able to register the same user name and email again
   today, at some point things get/were deleted here?)

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/conditional-statement-for-two-conditions/#post-1674684)
 * How about:
 *     ```
       <?php if( is_category('5') || ( is_single() && in_category('5') ) ) :?>
       [ ... ]
       <?php endif;?>
       ```
   
 * [http://codex.wordpress.org/Conditional_Tags](http://codex.wordpress.org/Conditional_Tags)
 *  Thread Starter [rezag](https://wordpress.org/support/users/rezag/)
 * (@rezag)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/conditional-statement-for-two-conditions/#post-1674701)
 * File that under I should have known that already hehe
 * Thanx

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

The topic ‘Conditional statement for two conditions’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [rezag](https://wordpress.org/support/users/rezag/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/conditional-statement-for-two-conditions/#post-1674701)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
