Title: Conditional Tags
Last modified: August 18, 2016

---

# Conditional Tags

 *  [Salvatore](https://wordpress.org/support/users/salvatore/)
 * (@salvatore)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/conditional-tags-2/)
 * I just want to say to WP to load a particular header when there is a post filed
   under a specific category. The conditional tag “is_category()” is not able when
   the single post is visualized, while I wouldn’t use “is_single() ” for every 
   single post of that specific category: is there any way to do that?
 * Thanks.

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

 *  [Minna](https://wordpress.org/support/users/minna/)
 * (@minna)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/conditional-tags-2/#post-197987)
 * I found this on the Codex page for [is_category tag](http://codex.wordpress.org/Template_Tags/in_category#Use_OUTSIDE_The_Loop):
   `
   <?php $post = $wp_query->post; if ( in_category('1') ) { ?> that particular header
   <?php } ?> I tried that in my Post template, single.php, (inside the loop, despite
   the header in Codex) and it worked.
 *  Thread Starter [Salvatore](https://wordpress.org/support/users/salvatore/)
 * (@salvatore)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/conditional-tags-2/#post-197988)
 * Oh, I’ve submitted this string but nothing has changed: what’s wrong?
 * <?php
    $post = $wp_query->post; if ( in_category(‘2’) ) { include(TEMPLATEPATH.‘/
   menu.musica.php’); } ?>
 *  [Minna](https://wordpress.org/support/users/minna/)
 * (@minna)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/conditional-tags-2/#post-197989)
 * What site are you working on? The one linked from your name? Can you point to
   an example where it’s supposed to be working? Where did you put that bit of code?
 * Is the file where include() expects it to be? Does it have adequate permissions?
 *  Thread Starter [Salvatore](https://wordpress.org/support/users/salvatore/)
 * (@salvatore)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/conditional-tags-2/#post-197991)
 * Site is this: [http://www.winnicott.it/blog/](http://www.winnicott.it/blog/)
   
   The header works on: [http://www.winnicott.it/blog/index.php/category/musica/](http://www.winnicott.it/blog/index.php/category/musica/)
   The code is on “inc.myheader.php” in the main directory of the blog.
 *  [Minna](https://wordpress.org/support/users/minna/)
 * (@minna)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/conditional-tags-2/#post-197993)
 * Could you test if you can get *anything* (normal text) printed on the page with
   the code snippet?
 *  Thread Starter [Salvatore](https://wordpress.org/support/users/salvatore/)
 * (@salvatore)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/conditional-tags-2/#post-197996)
 * Done, and nothing is happened…

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

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [Salvatore](https://wordpress.org/support/users/salvatore/)
 * Last activity: [21 years, 1 month ago](https://wordpress.org/support/topic/conditional-tags-2/#post-197996)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
