• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Remove Sidebar On Genesis Home, Page or Posts

The easiest way to remove a sidebar from your home page if using a Genesis child theme is to add this code to your child theme’s home.php file.

remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );

Make sure you add the PHP code before the genesis(); tag.

You could also add CSS code to your child themes style.css file to hide the sidebar from your home page:

.home #sidebar {
display: none;
}

Once you remove the sidebar from your home page, you may want to increase the content area to 100% width to fill the white space from where you’ve removed the sidebar.

.home #content {
width: 100%;
}

Change the percentage if you don’t want to display full width content.

Remove Sidebar on Pages and Posts

Simple change the layout settings to full width.

Full Width Page Layout Settings

Or you can find your post or page i.d in your source code and use it with CSS code in your child themes style.css file.

.postid-37900 #sidebar {
display: none;
}

Remove Sidebar From Archive Pages Using CSS

Removing the sidebar from archive pages like your blog or category archives is very similar to removing the sidebar from static pages.

Grab the category i.d or page template name from your body class in the source code and use it with CSS code in your child themes style.css file.

.page-template-page_blog-php #sidebar {
display: none;
}

Related Tutorials

  • Add Custom Sidebar & Remove Primary Sidebar

Reader Interactions

Comments

  1. Michelle says

    July 20, 2014 at 10:49 pm

    This helped me solve a problem I was having, although I had to alter the code. I wanted to use the widgetized homepage of the Foodie theme, while maintaining the sidebar as the “default” for the rest of the site (so it not only appears on the main blog page, but also category pages, etc).

    This PHP didn’t seem to work for me, but I just put in this CSS (classes instead of ids):

    .home .sidebar-primary {
     display: none;
    }
    
    .home .content {
    width: 100%;
    }
    Log in to Reply
    • Brad Dalton says

      July 20, 2014 at 10:52 pm

      Hello MIchelle.

      Which PHP code didn’t work?

      Log in to Reply
  2. Greg says

    June 30, 2014 at 3:13 am

    Hi Brad, I am trying to remove the sidebar from a single page and when I try and change the layout setting it doesn’t change my default choice. I followed the link to theme settings and I cant change it there either. I’m using genesis eleven40

    any ideas. thanks

    Log in to Reply
    • Brad Dalton says

      June 30, 2014 at 3:56 am

      Which page? It may be overwritten by some code or a plugin.

      Another option is to use code. http://wpsites.net/web-design/change-layout-based-on-any-conditions/

      Log in to Reply
      • Greg says

        June 30, 2014 at 4:40 am

        Hi Brad, any page , even when I try and create it as new page or post for that matter. I can see the layout setting but it wont except any chose. when I click on it.

        Ill try deactivating a few of the genesis ones and see if it works. 🙂

        Log in to Reply
        • Brad Dalton says

          June 30, 2014 at 4:43 am

          I would bulk deactivate all plugins and see if that works.

          Otherwise, you can use the code i linked to.

          Log in to Reply
          • Greg says

            July 2, 2014 at 12:53 am

            Turns out the new genesis 2.1 update fixed the issue, I think it was an IE11 problem

          • Brad Dalton says

            July 2, 2014 at 4:01 am

            Glad you fixed it, its getting complicated with browser issues and Mobile responsiveness!

  3. Steve says

    January 8, 2014 at 1:38 pm

    Hey, thanks for this tutorial, I know that I may sound like a dweeb but how do I do this for the product page? For all product pages that is, thanks!

    Log in to Reply
    • Brad Dalton says

      January 8, 2014 at 6:43 pm

      Add the code in your child themes functions file.

      It sounds like you’re using WooCommerce who supply a huge range of hooks, filters and conditional tags.

      You can use either PHP or CSS code.

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.