Remove sidebar

Discussion in 'WordPress' started by cag8f, May 5, 2014.

  1. #1
    Hi all. I'm brand new to Wordpress and attempting to remove the content sidebar from the 2014 theme. I've found a lot of documentation in the forums, but most all say I need to remove the

    <?php get_sidebar(); ?>

    line from my theme's page.php. I'm having problems doing this though. I'm not using the 2014 theme as installed on my server. I created a child theme from the 2014 theme, as per the Wordpress codex. As such, my child theme directory does not contain a page.php file. Can anyone offer guidance? Thanks in advance.
     
    cag8f, May 5, 2014 IP
  2. TIEro

    TIEro Active Member

    Messages:
    741
    Likes Received:
    177
    Best Answers:
    5
    Trophy Points:
    70
    #2
    Copy the page.php file into your child theme folder and delete the line from it there. It will supersede the one in the default folder (or should, assuming everything works normally!).
     
    TIEro, May 5, 2014 IP
  3. cag8f

    cag8f Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Thanks. I did that. The page.php file contains two potential snippets of interest. Should I just delete the first?

    <?php get_sidebar( 'content' ); ?>

    <?php
    get_sidebar();
    get_footer();
     
    cag8f, May 5, 2014 IP
  4. cag8f

    cag8f Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    I removed the first only, but the sidebar remained. I then removed both, and the sidebar still remained.
     
    cag8f, May 5, 2014 IP
  5. TIEro

    TIEro Active Member

    Messages:
    741
    Likes Received:
    177
    Best Answers:
    5
    Trophy Points:
    70
    #5
    This will remove the sidebar called "content", assuming there are multiple sidebars.

    Did you remove the get_sidebar calls in ALL the templates? page.php is only used for pages: single.php is used for single posts, archive.php for archives, etc. (See http://codex.wordpress.org/Template_Hierarchy for a useful diagram.)

    Chances are you want to remove the sidebar on posts and have only removed it on pages.
     
    TIEro, May 6, 2014 IP
  6. cag8f

    cag8f Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #6
    >> Chances are you want to remove the sidebar on posts and have only removed it on pages.

    Ah you are correct. I had removed it for the page template, but was displaying a post on my home page. Thanks!
     
    cag8f, May 6, 2014 IP