Title: Conditional tags misbehaving
Last modified: August 19, 2016

---

# Conditional tags misbehaving

 *  [mixmanner](https://wordpress.org/support/users/mixmanner/)
 * (@mixmanner)
 * [18 years ago](https://wordpress.org/support/topic/conditional-tags-misbehaving/)
 * My conditional tags work right in the header, on the various content pages, but
   not in the footer. If I’m on a page and I just run a simple test like:
 * `
    <?php if ( is_page() ) echo "It's a page!"; ?>
 * It will echo correctly if I put it in the header or in the content area, but 
   it won’t in the footer. Eventually I figured out it’s registering is_home(). 
   For some reason on a page, the footer thinks it’s actually the home page. The
   footer correctly displays other conditional tags though, for instance, when it’s
   a search page the footer registers is_search().
 * Anyone know what might be the problem?

Viewing 1 replies (of 1 total)

 *  Thread Starter [mixmanner](https://wordpress.org/support/users/mixmanner/)
 * (@mixmanner)
 * [18 years ago](https://wordpress.org/support/topic/conditional-tags-misbehaving/#post-770782)
 * Well, I know why it’s doing it, I think. All the conditional tags are based off
   of the query. If you query a page_id it think it’s a page, if you query a post
   it thinks it’s a single. I guess that kind of makes sense, but what if somebody
   wants to have a custom query on a page, then conditional tags won’t work after
   the query. Or is there some way that I missed?

Viewing 1 replies (of 1 total)

The topic ‘Conditional tags misbehaving’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [mixmanner](https://wordpress.org/support/users/mixmanner/)
 * Last activity: [18 years ago](https://wordpress.org/support/topic/conditional-tags-misbehaving/#post-770782)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
