Title: Diffirent sidebar for single posts
Last modified: August 18, 2016

---

# Diffirent sidebar for single posts

 *  Resolved [fakelvis](https://wordpress.org/support/users/fakelvis/)
 * (@fakelvis)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/diffirent-sidebar-for-single-posts/)
 * Hi,
 * I would like to display a different sidebar when a user is viewing a single post.
 * I could do this by creating single.php, then copying everything and calling a
   new file, say, singlefooter.php which in turn calls my new sidebar.
 * This is so long-winded though and I was wondering if there’s an easier way.
 * On my sidebar.php file I was hoping to run an if statement to see if it was displaying
   a single post. If so display one thing, if not the other.
 * It’s only a small difference (displaying a 1-picture flickr badge rather than
   a 5-picture badge) so don’t fancy creating all the new files for one small change.
 * Basically what do I need to call in my if statement to see if it is a single 
   post?
 * Thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [fakelvis](https://wordpress.org/support/users/fakelvis/)
 * (@fakelvis)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/diffirent-sidebar-for-single-posts/#post-442448)
 * After a few extra hours of searching I came across the conditional tags. Bingo.
 * Just so others know, I’ve done the following:
 * <?php if (is_single())
    { echo’1′; } else { echo’2′; } ?>
 * Substituting 1 for the html code when it is a single post and substituting 2 
   for the html code for other times.
 * Hope this helps someone else too.

Viewing 1 replies (of 1 total)

The topic ‘Diffirent sidebar for single posts’ is closed to new replies.

## Tags

 * [if](https://wordpress.org/support/topic-tag/if/)
 * [sidebar.php](https://wordpress.org/support/topic-tag/sidebar-php/)
 * [single.php](https://wordpress.org/support/topic-tag/single-php/)

 * 1 reply
 * 1 participant
 * Last reply from: [fakelvis](https://wordpress.org/support/users/fakelvis/)
 * Last activity: [19 years, 9 months ago](https://wordpress.org/support/topic/diffirent-sidebar-for-single-posts/#post-442448)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
