Title: Variable Sidebar Content Problem
Last modified: August 18, 2016

---

# Variable Sidebar Content Problem

 *  [dang_blue](https://wordpress.org/support/users/dang_blue/)
 * (@dang_blue)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/variable-sidebar-content-problem/)
 * Hi,
    I’ve read Variable Sidebar Content Example in [http://codex.wordpress.org/Conditional_Tags](http://codex.wordpress.org/Conditional_Tags)
   anh try to follow it. So I wrote these code in sidebar.php:
 * <?php
    if (is_single()) { echo ‘This is Single!’; } elseif (is_home()) { echo‘
   This is home!’; } elseif (is_category()) { echo ‘This is category!’; } else {
   echo ‘This is not single!’; } ?>
 * Then, when I was in home page, it showed “This is Home” (correct), But when I
   viewed catagory page, it showed “This is Home” (incorrect) and when I viewed 
   single post, it still showed “This is Home” (incorrect).
 * What’s the problem? And how to solve this?

Viewing 1 replies (of 1 total)

 *  Thread Starter [dang_blue](https://wordpress.org/support/users/dang_blue/)
 * (@dang_blue)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/variable-sidebar-content-problem/#post-371371)
 * no one wants to help me?
    What’s wrong with my post?

Viewing 1 replies (of 1 total)

The topic ‘Variable Sidebar Content Problem’ is closed to new replies.

## Tags

 * [content](https://wordpress.org/support/topic-tag/content/)
 * [variable](https://wordpress.org/support/topic-tag/variable/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [dang_blue](https://wordpress.org/support/users/dang_blue/)
 * Last activity: [20 years, 2 months ago](https://wordpress.org/support/topic/variable-sidebar-content-problem/#post-371371)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
