Title: conditional elements showing in wrong location
Last modified: August 19, 2016

---

# conditional elements showing in wrong location

 *  [matt adams](https://wordpress.org/support/users/factor1/)
 * (@factor1)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/conditional-elements-showing-in-wrong-location/)
 * I am attemtping to use a conditional statement to show more sidebar info if on
   a specific page.
 *     ```
       <? if (is_page('updates') ) {
         		 get_sidebar();
       		}
       		else {} ?>
       ```
   
 * This is in a side bar div, on my header.php file.
    its working. When on the updates
   page, it will get the sidebar.php.
 * the issue is that it displays the sidebar.php in the post entry, not the sidebar
   div.
 * any way to do this better?

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

 *  Thread Starter [matt adams](https://wordpress.org/support/users/factor1/)
 * (@factor1)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/conditional-elements-showing-in-wrong-location/#post-1439802)
 * i think another option is to move all my sidebar content into sidebar.php, and
   use a conditional statement to show /hide the additional elements i want on the
   specific page.
 *  [Andrei Olsen](https://wordpress.org/support/users/nebulus/)
 * (@nebulus)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/conditional-elements-showing-in-wrong-location/#post-1439804)
 * Yes, that’s exactly what you should do.
 *  Thread Starter [matt adams](https://wordpress.org/support/users/factor1/)
 * (@factor1)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/conditional-elements-showing-in-wrong-location/#post-1439932)
 * using the default sidebar, with my conditional statements worked better.

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

The topic ‘conditional elements showing in wrong location’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [matt adams](https://wordpress.org/support/users/factor1/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/conditional-elements-showing-in-wrong-location/#post-1439932)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
