Title: Problem using is_home
Last modified: August 22, 2016

---

# Problem using is_home

 *  Resolved [taghaboy](https://wordpress.org/support/users/taghaboy/)
 * (@taghaboy)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/problem-using-is_home/)
 * Hi every one,
 * I try with **is_home** and also with **is_front_page** to show the div “top_line”
   only in the home page. And in others pages the **banner** “top-ban-header”.
 * BUT in every page in the website it always show the “top_line” not the banner!
 * This is my code, what wrong :
 *     ```
       <?php if(!is_home()) { ?>
       	<div id="top-line"></div>
       <?php } else { ?>
       	<div id="top-ban-header"></div>
       <?php } ?>
       ```
   
 * Thanks for the help.

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

 *  [Alen](https://wordpress.org/support/users/alenma/)
 * (@alenma)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/problem-using-is_home/#post-5498568)
 * try Reversing it.
 *     ```
       <?php if(is_home()) { ?>
       	<div id="top-ban-header"></div>
       <?php } else { ?>
       	<div id="top-line"></div>
       <?php } ?>
       ```
   
 * Hope it will help.
 *  Thread Starter [taghaboy](https://wordpress.org/support/users/taghaboy/)
 * (@taghaboy)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/problem-using-is_home/#post-5498595)
 * Thanks for ur reply,
    I’m sorry it dont work, really i dont know what happen !!!
 *  Thread Starter [taghaboy](https://wordpress.org/support/users/taghaboy/)
 * (@taghaboy)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/problem-using-is_home/#post-5498620)
 * With this code it work so Good 🙂
 *     ```
       <?php if(is_front_page()){ ?>
       	  <div id="top-line"></div>
       <?php } else { ?>
       	  <div id="top-ban-header"></div>
       <?php } ?>
       ```
   
 *  [Alen](https://wordpress.org/support/users/alenma/)
 * (@alenma)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/problem-using-is_home/#post-5498668)
 * My bad. I didn’t read the post well. the only wrong on your code is the not(!)…
 * Oh well… you solve it. 🙂
 *  Thread Starter [taghaboy](https://wordpress.org/support/users/taghaboy/)
 * (@taghaboy)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/problem-using-is_home/#post-5498703)
 * I just change your code (is home to is front page) so thank you 🙂

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

The topic ‘Problem using is_home’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [taghaboy](https://wordpress.org/support/users/taghaboy/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/problem-using-is_home/#post-5498703)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
