• I’m currently testing a WordPress installation on a test server before getting access to the actual server in the next few days. It’s all going pretty smoothly so far, but I would love to be able to remove the sidebar from the static pages, and only keep it on the posts page.
    I have googled, searched the support articles and tried pretty much everything, but apparently I’m missing something obvious here, since the sidebar won’t budge. Would anybody be able to help with this?
    The theme is the latest version of the free Station theme, which might be updated to the paid version at some point on the actual server, if it appears to be necessary.
    The current pages are there only for testing purposes, hope it’s still ok to ask here – I would love to have this solved while still testing… πŸ™‚
    Thanks in advance!
    The test site is here.

Viewing 13 replies - 1 through 13 (of 13 total)
  • <?php
     if(!is_page('SPECIFIC PAGE')) get_sidebar();
    ?>

    OR remove this functionget_sidebar(); from page.php file

    Thread Starter Papousek

    (@papousek)

    Thanks! The page.php of that particular theme doesn’t have that, I bumped into that solution already earlier and checked.
    The page.php looks like this: <?php
    get_header();
    get_template_part(‘library/template_posts’);
    get_footer();
    ?>
    I’ve also tried something similar to the first suggestion but it didn’t work, but I’ll give it another try. It’s probably something to do with the theme, or maybe I’m just putting it in the wrong place. However I really like the theme otherwise and would like to keep it…

    open library/template_posts.php file and there have that functions

    like <?php if(!$fullwidth) get_sidebar(); ?>

    change this as <?php if(!$fullwidth || !is_page()) get_sidebar(); ?>.

    Thread Starter Papousek

    (@papousek)

    That doesn’t do anything I’m afraid.
    If I put <?php
    if(!is_page(‘SPECIFIC PAGE’)) get_sidebar();
    ?>
    to page.php, it results in the sidebar showing correctly on the selected page, but on the others there’s still a sidebar, only an empty one, and the language selection, which is currently the only item on the sidebar, is moved in a box of its own on the upper left hand corner. So apparently the page width would need to be changed as well, but also the empty sidebar is there still. Looks like this

    when you are creating a new page then select the template as full width content not default template(at the right panel)

    Thread Starter Papousek

    (@papousek)

    Well, at the moment I’m stuck creating the custom template for a full width page. Haven’t done this so much, and it looks like nothing is in where I would expect it to be in this theme. Can’t find anything like what’s described here or here, also there is no <div id=”contentwide”> in the code of the page.php.
    Also I should figure out a way to move the language selection box away from the upper left, or at least make it smaller, as it doesn’t look good like that and also distorts the image orientation. Somewhere next to the search box or even replacing it would be nice, only not sure if there’s a way to do that so that it would show up correctly. Looks like this is going to be trickier than I think… πŸ™

    Thread Starter Papousek

    (@papousek)

    OK, getting there, this:

    <?php
    /*
    Template Name: wide
    */
    ?>
    
    <?php get_header(); ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post();?>
    
    <?php the_content(); ?>
    
    <?php endwhile; endif; ?>
    
    <?php get_footer(); ?>

    produced this. In the end it wasn’t necessary to adjust the page width.
    Obviously it would be nice to have the same kind of template box as there is on the pages with the side bar, but I can settle for what it is at the moment.
    Now I just need to figure out if it’s possible to put the language button somewhere where it would be visible without the sidebar…

    Thread Starter Papousek

    (@papousek)

    Just removed the double post, sorry!

    Thread Starter Papousek

    (@papousek)

    OK, getting there, this:

    <?php
    /*
    Template Name: wide
    */
    ?>
    
    <?php get_header(); ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post();?>
    
    <?php the_content(); ?>
    
    <?php endwhile; endif; ?>
    
    <?php get_footer(); ?>

    produced this. In the end it wasn’t necessary to adjust the page width.
    Obviously it would be nice to have the same kind of template box as there is on the pages with the side bar, but I can settle for what it is at the moment.
    Now I just need to figure out if it’s possible to put the language button somewhere where it would be visible without the sidebar…

    Moderator t-p

    (@t-p)

    unless i am missing something, there is an easy way of creating Pages Without Sidebar:

    when you are creating a new page (in admin) then select the template as full width content (without the sidebar) or the default template (look at the right panel in admin).

    Thread Starter Papousek

    (@papousek)

    That’s just what I did, only there wasn’t any template, I had to create it and do a couple of other adjustments as well.

    Thread Starter Papousek

    (@papousek)

    Many thanks for the help, I’ve now removed the sidebar from one page and will shortly be upgarding to the paid version of the theme which has several nice built-in page templates. πŸ™‚

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Removing the sidebar on specific pages’ is closed to new replies.