Remove sidebar for static pages, keep for blog
-
So I’ve been looking around to find a way to get rid of my sidebar in all of my static pages BUT make it show up in my blog page. From searching, all I found was ways to make different content show up in the sidebar. I want to completely remove it and make the space it is regularly taking up useful to my static pages.
From what I know, I need to use If statements. Also I figured out I should modify the code in my index.php file. Particularly edit the call for the sidebar so if it’s viewing my news/blog page (my front page is static by the way and my blog is actually page id 2) then it will show the sidebar and ifelse don’t show the sidebar.
<?php get_sidebar(); ?>
is what I need to change. Does anyone know how to do this? I understand it in theory but I’m completely unsure of how to write the code.It sounds so simple but I have no idea on how to use the if statement to show a sidebar and for everything else don’t show it.
Thanks.
- The topic ‘Remove sidebar for static pages, keep for blog’ is closed to new replies.