Title: Conditional Tag, Outside Loop?
Last modified: August 19, 2016

---

# Conditional Tag, Outside Loop?

 *  Resolved [justbishop](https://wordpress.org/support/users/justbishop/)
 * (@justbishop)
 * [16 years ago](https://wordpress.org/support/topic/conditional-tag-outside-loop/)
 * Wondering if there’s a way to tell my header nav:
 * “if a tag with slug ‘xyz’ exists on this blog, spit out this html: `<li>http://
   www.mysite.com/tag/xyz/</li>`“
 * Is this possible?

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

 *  [lindsayanng](https://wordpress.org/support/users/lindsayanng/)
 * (@lindsayanng)
 * [16 years ago](https://wordpress.org/support/topic/conditional-tag-outside-loop/#post-1520489)
 * I am pretty sure that conditional tags work the same inside the header.php file
   as they would in the index.php or loop pages
 * According to the codex you can use conditional tags in the header, if you use
   them in the footer you need to reset first then use them
 *  Thread Starter [justbishop](https://wordpress.org/support/users/justbishop/)
 * (@justbishop)
 * [16 years ago](https://wordpress.org/support/topic/conditional-tag-outside-loop/#post-1520622)
 * Thanks 🙂
 * I’m having trouble wrapping my brain around the actual code that would do the
   conditional for if a tag slug exists or not. Can anyone point me in the right
   direction on that part?
 *  Thread Starter [justbishop](https://wordpress.org/support/users/justbishop/)
 * (@justbishop)
 * [16 years ago](https://wordpress.org/support/topic/conditional-tag-outside-loop/#post-1520678)
 * Ok, nevermind everyone! I decided to just widgetize my header navigation area
   and through the wonders of the WP 3.0 custom menu system, create a custom header
   nav menu and drag the widget to the newly widgetized header. Worked like a charm!!!
 * If anyone else is interested in doing something similar, this was an awesome 
   tut:
 * [http://www.themelab.com/2008/04/18/see-how-easy-it-is-to-widgetize-wordpress-themes/](http://www.themelab.com/2008/04/18/see-how-easy-it-is-to-widgetize-wordpress-themes/)

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

The topic ‘Conditional Tag, Outside Loop?’ is closed to new replies.

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [justbishop](https://wordpress.org/support/users/justbishop/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/conditional-tag-outside-loop/#post-1520678)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
