Title: &lt;?php if (is_page(Home)): ?&gt; problem
Last modified: August 19, 2016

---

# <?php if (is_page(Home)): ?> problem

 *  [gadzilla](https://wordpress.org/support/users/gadzilla/)
 * (@gadzilla)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/if-frontpage-problem/)
 * Hi Guys,
 * I’m a total PHP and wordpress nube so can you tell me why the code below does
   not work?
 * I basically want to display something on the frontpage(home) and something else
   on the rest of the pages.
 * I was trying to make a if else endif kinda solution but it does not work.
 *     ```
       <?php if (is_page(Home)): ?>
       <div id="sidebarfront">
       <div id="bannerside">
       <img src="http://gadzilla.dk.linux7.curanetserver.dk/wp-content/uploads/banner.jpg" width="280" height="200" /></div>
               <div id="bannerside"><img src="http://gadzilla.dk.linux7.curanetserver.dk/wp-content/uploads/tilmeldnyhedsbrev_head.png" width="211" height="19" />
                         <p>
                           <input name="textfield" type="text" class="newsmail_text" id="textfield" value="Navn" />
                         </p>
                         <p>
                           <input name="textfield2" type="text" class="newsmail_text" id="textfield2" value="Email" />
                         </p></div>
               <div id="bannerside"><img src="http://gadzilla.dk.linux7.curanetserver.dk/wp-content/uploads/tipenven_head.png" width="105" height="19" />
                         <p>
                           <input name="textfield3" type="text" class="newsmail_text" id="textfield3" value="Dit navn" />
                                         </p>
                         <p>
                             <input name="textfield3" type="text" class="newsmail_text" id="textfield4" value="Din vens navn" />
                         </p>                  <p>
                           <input name="textfield4" type="text" class="newsmail_text" id="textfield5" value="Din vens email" />
                         </p></div>
       <?php else: ?>
       <div id="sidebar">
       <div id="submenu">
         <ul>
           <?php include("submenu.php"); ?>
         </ul>
       </div>
       <?php endif; ?>
       ```
   

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

 *  Thread Starter [gadzilla](https://wordpress.org/support/users/gadzilla/)
 * (@gadzilla)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/if-frontpage-problem/#post-1528295)
 * I found out what was wrong.
 * I had to use the `<?php if (is_front_page()): ?>` instead, since you cannot use`
   <?php if (is_page(Frontpage)): ?>` for detecting the front page or home page.
 * Also i had to use the `<?php wp_reset_query(); ?>` before the `<?php if (is_front_page()):?
   >` to make it work.
 * Read more about that here: <a´href=”[http://wordpress.org/support/topic/269988?replies=14″&gt](http://wordpress.org/support/topic/269988?replies=14″&gt);
 * So my code looks like this now:
 * `<?php
    /** * [@package](https://wordpress.org/support/users/package/) WordPress*@
   subpackage Default_Theme */ ?> <?php wp_reset_query(); ?> <?php if (is_front_page()):?
   > <div id=”sidebarfront”> <div id=”bannerside”> <img src=”[http://gadzilla.dk.linux7.curanetserver.dk/wp-content/uploads/banner.jpg&#8221](http://gadzilla.dk.linux7.curanetserver.dk/wp-content/uploads/banner.jpg&#8221);
   width=”280″ height=”200″ /></div> <div id=”bannerside”><img src=”[http://gadzilla.dk.linux7.curanetserver.dk/wp-content/uploads/tilmeldnyhedsbrev_head.png&#8221](http://gadzilla.dk.linux7.curanetserver.dk/wp-content/uploads/tilmeldnyhedsbrev_head.png&#8221);
   width=”211″ height=”19″ /> <p> <input name=”textfield” type=”text” class=”newsmail_text”
   id=”textfield” value=”Navn” /> </p> <p> <input name=”textfield2″ type=”text” 
   class=”newsmail_text” id=”textfield2″ value=”Email” /> </p></div> <div id=”bannerside”
   ><img src=”[http://gadzilla.dk.linux7.curanetserver.dk/wp-content/uploads/tipenven_head.png&#8221](http://gadzilla.dk.linux7.curanetserver.dk/wp-content/uploads/tipenven_head.png&#8221);
   width=”105″ height=”19″ /> <p> <input name=”textfield3″ type=”text” class=”newsmail_text”
   id=”textfield3″ value=”Dit navn” /> </p> <p> <input name=”textfield3″ type=”text”
   class=”newsmail_text” id=”textfield4″ value=”Din vens navn” /> </p> <p> <input
   name=”textfield4″ type=”text” class=”newsmail_text” id=”textfield5″ value=”Din
   vens email” /> </p></div> <?php else: ?> <div id=”sidebar”> <div id=”submenu”
   >
    -  <?php include(“submenu.php”); ?>
 * </div>
    <?php endif; ?>’
 * I hope this can save somebody else some time.
 *  [iselorm](https://wordpress.org/support/users/iselorm/)
 * (@iselorm)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/if-frontpage-problem/#post-1528472)
 * thanks… did save me quite a headache!

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

The topic ‘<?php if (is_page(Home)): ?> problem’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [iselorm](https://wordpress.org/support/users/iselorm/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/if-frontpage-problem/#post-1528472)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
