Your WordPress blog sidebar is an essential element of your blog, however, on some occasions you might not want it to be displayed on your blog post pages.
To hide your sidebar on your blog post pages, edit the single.php file from your theme (if your theme doesn’t include this file, edit the index.php file) and look for the following snippet of code:
1
<?php get_sidebar(); ?>and replace it with:
1 2 3 4 5
<?php if(!is_single()) {
get_sidebar();
} ?>You’re done! Your sidebar will be displayed on all your blog pages except single post pages.


Cool new trick, I like it! Thanks again!
You’re welcome ;)
If I try this and I don’t like how it looks is it easy to undo?
Of course, you just go back and erase what you put in. It’s very simple and definitely worth a try!
Thanks for sharing your sweet new moves with us, I feel like we’re sharing cheat codes hahaha!
I always think the exact same thing haha! Gamers unite!
I’m always glad if these tricks can help!
Excellent and simple feat)) Thanks a lot for it!)
Little off topic, but I LOVE what you’ve done with the place! Looks super fancy and high-tech, you can tell you’ve really thought this out. I hope it brings you much success in this new year!
Thanks for the kind words :)
Interesting! I wonder if this is something that will please readers more… I guess it couldn’t hurt to try it! Thanks again for sharing, and love the new layout!
Definitely going to try this one out, seems simple enough but very cool…