Title: Conditional tags
Last modified: August 18, 2016

---

# Conditional tags

 *  [dewall](https://wordpress.org/support/users/dewall/)
 * (@dewall)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/conditional-tags-1/)
 * I have tried to use conditional tags in my sidebar.php to show certain content
   for certain pages
 * `<li><?php /* If this is the frontpage */ if ( is_home() ) { ?>
    <h2><?php _e('
   Om vondewall.com'); ?></h2> <p class="test">V&auml;lkommen till <strike>v&aring;
   r</strike> Gustafs lekstuga p&aring; webben. H&auml;r hittar Tobias och Toves
   sl&auml;ktingar och v&auml;nner i n&auml;r och fj&auml;rran bilder s&aring; de
   kan f&ouml;lja med i vad som h&auml;nder i Tobias och Toves liv. </li> <?php }?
   >
 * `<li><?php /* If this is the Arkiv */ if ( is_page(42) ) { ?>
    <h2><?php _e('
   Om arkiven'); ?></h2> <p class="test">H&auml;r kan du leta i v&aring;rt arkiv
   f&ouml;r att hitta exakt vad du s&ouml;ker. Arkiven &auml;r sorterad &aring;rs-
   och m&aring;nadsvis. Du kan &auml;ven g&aring; igenom alla nyheterna baserade
   p&aring; vilken kategori de har sorterats in under. </li> <?php } ?>
 * etc
 * In my sidebar I have used this approach set up conditional tags fÃ¶r fÃ¶r 6 pages.
 * My idea was to use the tags to show a description based on the page the visitor
   was viewing.
 * In Firefox and Safari this aproach works fine. In Interner Explorer, however,
   the right content in the sidebar is shown but the design is messed up. It seems
   as Internet Explorer leaves a blank space fÃ¶r the conditional tags that are 
   not shown.
 * Any suggestions on how to solve this?

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

 *  [pcmt](https://wordpress.org/support/users/pcmt/)
 * (@pcmt)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/conditional-tags-1/#post-258406)
 * I’m not sure, but maybe the conditional tag should come before the list tag, 
   instead of being inside it.
 * <?php /* If this is the Arkiv */ if ( is_page(42) ) { ?>
 * List…
 * <?php } ?>
 *  Thread Starter [dewall](https://wordpress.org/support/users/dewall/)
 * (@dewall)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/conditional-tags-1/#post-258408)
 * You are a genious!!! It worked. Thanks for your help
 *  [skiene](https://wordpress.org/support/users/skiene/)
 * (@skiene)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/conditional-tags-1/#post-258966)
 * I got a quite similar problem:
    When I use <?php if ( is_home() ) { ?> to have
   a different formatting for the individual posts, my sidebar in which the conditional
   tag is used shows double when is_home is filled, but only in Internet Explorer.
 * Any suggestions? 😉
 * The site is [http://www.nachtjournal.com](http://www.nachtjournal.com)
 * Thanks for your help!
 *  [lonelychina](https://wordpress.org/support/users/lonelychina/)
 * (@lonelychina)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/conditional-tags-1/#post-258967)
 * pcmt, the code you have posted seems to the one I was looking for. But, I am 
   a newbie can you put the code little detailed?
    Thanks.

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

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

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 4 participants
 * Last reply from: [lonelychina](https://wordpress.org/support/users/lonelychina/)
 * Last activity: [20 years, 6 months ago](https://wordpress.org/support/topic/conditional-tags-1/#post-258967)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
