Skip to:
Content
Pages
Categories
Search
Top
Bottom

Sidebar Removal


  • codyecp
    Participant

    @codyecp

    Can someone please for the love of god, tell me step by step (like stupid simple) how to remove the sidebar widget area from only the pages after the member subfolder (not all member pages, because I still need a widget for the members page.

    So basically anything after the last subfolder in this URL: http://www.mysite.com/members/

    Some help would be seriously appreciated… I’ve been at this for hours and hours and know next to nothing about PHP. And I crashed the site once, had to delete and reinstall buddypress.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

  • Boone Gorges
    Keymaster

    @boonebgorges

    What theme are you using? At a basic level, this is a theme-level issue, because the structure of your page templates (two-column vs one-column) is, at root, a question of what’s made available in your theme.

    > remove the sidebar widget area from only the pages after the member subfolder (not all member pages, because I still need a widget for the members page.

    If I understand correctly, you mean that example.com/members/ *should* have a sidebar, and example.com/members/* (any page under /members/) should *not*. If so, you’ll need to include some special BP-specific logic, because from WP’s point of view all pages under /members/ are “the same page”. But the details of how this will be done depend on the kind of theme you’re using.


    codyecp
    Participant

    @codyecp

    Hey,

    First off, thank you so much for the response! Have been scratching my head over this for far too long.

    Theme is Vertex by Elegant Themes. I actually downloaded a plugin (custom sidebars) so that I could create multiple sidebars for other pages.

    And yes, you are understanding me correctly. Finding a lot of the file locations has been the toughest part.

    Thanks again for the help!


    Boone Gorges
    Keymaster

    @boonebgorges

    Thanks for the additional details.

    I don’t have access to the Vertex theme, so it’s hard to give precise instructions. But what you’ll need to do first is to identify whether the theme comes with a full-width (or one-column) page template. I’m guessing that it does. (You can test by creating a test page, then selecting the various Template options from the dropdown under Page Attributes when editing the page. Cycle through them, save the page, and view it on the front end until you find one that displays the page content without the sidebar.)

    Then you’ll need to identify the theme file that is powering this template. The geeky way to do this is by looking at the source code of the Templates dropdown (page_template) and get the value of the option you’ve located. Then find this file in your theme directory wp-content/themes/vortex.

    Then: assuming you’re using a child theme of Vortex, create a directory wp-content/themes/vortex/members/single/. Copy the template you found to wp-content/themes/vortex/members/index-directory.php. That should be all you need to do.

    If you’re not using a child theme of vortex, this change will be overwritten next time you update the theme. In that case, the following filter should be an all-purpose solution. “full-width-template.php” should be replaced with the name of the template.

    
    function bbg_vortex_member_directory_templates( $templates ) {
        $my_template = WP_CONTENT_DIR . '/themes/vortex/full-width-template.php';
        return array_merge( array( $my_template ), $templates );
    }
    add_filter( 'bp_template_hierarchy_members_directory', 'bbg_vortex_member_directory_templates' );
    

    Boone Gorges
    Keymaster

    @boonebgorges

    Here’s more on how BP’s template hierarchy works. This is what you’re tapping into. https://codex.buddypress.org/themes/theme-compatibility-1-7/template-hierarchy/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sidebar Removal’ is closed to new replies.
Skip to toolbar