• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Remove sidebar from default page template

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Remove sidebar from default page template

This topic is: not resolved

Tagged: add primary sidebar, page template, remove sidebar

  • This topic has 13 replies, 3 voices, and was last updated 3 years, 4 months ago by seashore.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • November 6, 2019 at 11:35 am #494490
    seashore
    Participant

    I want to remove the sidebar from the default page template by modifying the php file instead of using css. Trying to hack/customize the genesis free child theme to make it look the way I want. I created a new file fullwidth.php and put it in my child theme folder page-templates. Then I added this code:

    // Removes sidebar.
    remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );

    Then in WP > edit page > page attributes > template, I toggled to "fullwidth". But when I view my page on the front end the sidebar is still there.

    Help please?

    http://rs.new.rswoodwinds.com/
    November 6, 2019 at 1:58 pm #494493
    Victor Font
    Moderator

    To remove a sidebar, you have to unregister it. Genesis has a better way to make a page full width. Just change the layour for that page. You can do it from the page editor or in code: https://my.studiopress.com/documentation/snippets/admin-management/force-the-genesis-layout-settings/


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    November 6, 2019 at 3:08 pm #494496
    seashore
    Participant

    Thank you so much for this great info. Question, if I follow the instructions in that link and apply the code to "Force full-width-content layout setting" in functions.php, does that affect all page templates? I was thinking of keeping the default template unchanged in case I want that sidebar on another page later on.

    Seems to me I want to modify something in my fullwidth.php file, no?

    Thanks again.

    November 6, 2019 at 4:10 pm #494499
    seashore
    Participant

    Also, I just renamed fullwidth.php to inside-pages.php and now in WP > edit page > page attributes > template, I see only "Default Template" and "Landing" as page options. There is no "inside-pages.php" page template option. Can you help me understand how to properly add a custom page that has no sidebar? Thanks again.

    November 7, 2019 at 8:59 am #494526
    Anita
    Keymaster

    @seashore you originally wrote:

    I want to remove the sidebar from the default page template...

    Are you trying to remove the sidebar completely from your website or are you trying to create a template of your own that does not have the Primary sidebar? Your responses are a little bit confusing.


    Love coffee, chocolate and my Bella!

    November 7, 2019 at 9:29 am #494527
    seashore
    Participant

    I would like to create a template of my own that does not have the Primary sidebar. I was thinking I could duplicate the existing default template then remove the sidebar, so I don't have to build the new page template from scratch.

    November 7, 2019 at 9:59 am #494529
    Anita
    Keymaster

    But what will you be displaying on the template? You can create many types of templates.


    Love coffee, chocolate and my Bella!

    November 7, 2019 at 10:06 am #494531
    seashore
    Participant

    How please, can I create a new page template that appears WP > edit page > page attributes > template, and has the same layout as the current default template but without the sidebar. I'm sorry I'm just confused why my question is coming across confusing.

    November 7, 2019 at 10:41 am #494533
    Anita
    Keymaster

    You do not need a template. If you want the entire website to be full width, you simply add the code from this page - https://my.studiopress.com/documentation/snippets/admin-management/force-the-genesis-layout-settings/ which is:

    //* Force full-width-content layout setting
    add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );

    If you want full width on the home page to remove the primary sidebar, you would need to locate the layout setting in front-page.php and modify that to be full width as indicated in the above code.

    You do not need a template.


    Love coffee, chocolate and my Bella!

    November 7, 2019 at 10:55 am #494536
    seashore
    Participant

    Ok thank you, so I placed that code at the very bottom of functions.php file inside my child theme folder, and I now see fullwidth pages. But let's say in a week I want to create a page with a sidebar, what is the best way to do that please? Thank you!

    November 7, 2019 at 10:59 am #494537
    Anita
    Keymaster

    @seashore I don't think you quite understand how Genesis works. If you want a full width page for a particular page - you select the full-width LAYOUT on the Edit screen. If you want a page or post with a sidebar - you select the content-sidebar or sidebar-content LAYOUT on the Edit Screen.


    Love coffee, chocolate and my Bella!

    November 7, 2019 at 11:04 am #494538
    seashore
    Participant

    I navigated to WP > Pages > edit page, and see "Layouts" where I can select prebuilt layouts but I do not want that. Is that what you meant by go to Edit screen and select full-width layout?

    November 7, 2019 at 11:31 am #494539
    Anita
    Keymaster

    I think you are the person who has found their answer in Genesis Slack. You really were not presenting the question here in the same manner as you did there.


    Love coffee, chocolate and my Bella!

    November 7, 2019 at 12:13 pm #494540
    seashore
    Participant

    It's alright, thank you Anita, have a good day.

  • Author
    Posts
Viewing 14 posts - 1 through 14 (of 14 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble