Skip to:
Content
Pages
Categories
Search
Top
Bottom

Sidebar issue on buddypress pages


  • havealookhere
    Participant

    @havealookhere

    Hello,

    After reading I think all of the forum post about this matter till ten years ago the issue I have is driving me nuts.

    I want to have the possibility to remove the sidebar on certain buddypress pages. Especially from the members page.

    So first I went into the page in the wordpress dashboard and switched the setting no sidebar on. When the page is not connected to a buddy press page the sidebar is gone. But, when i connect it to a buddypress page like members then the sidebar is back. I tried several setting, like full width, no sidebar, etc but everytime I make it a buddypress page in the buddypress settings the sidebar is back.

    Then I tried to make a child theme. I did put the buddypress nouveau part in the child theme, copied the members/index.php and members/members-loop.php into the sidebar. I saw this in the buddypress forum off two years ago. Then when editing the files, there is not a call to a sidebar so i cannot remove it.

    The index.php looks like this:

    <?php bp_nouveau_before_members_directory_content(); ?>
    
    	<?php if ( ! bp_nouveau_is_object_nav_in_sidebar() ) : ?>
    
    		<?php bp_get_template_part( 'common/nav/directory-nav' ); ?>
    
    	<?php endif; ?>
    
    	<div class="screen-content">
    
    	<?php bp_get_template_part( 'common/search-and-filters-bar' ); ?>
    
    		<div id="members-dir-list" class="members dir-list" data-bp-list="members">
    			<div id="bp-ajax-loader"><?php bp_nouveau_user_feedback( 'directory-members-loading' ); ?></div>
    		</div><!-- #members-dir-list -->
    
    		<?php bp_nouveau_after_members_directory_content(); ?>
    	</div><!-- // .screen-content -->
    
    	<?php bp_nouveau_after_directory_page(); ?>
    

    the only reference to the sidebar is <?php if ( ! bp_nouveau_is_object_nav_in_sidebar() ) : ?>

    When I delete this it breaks the website.

    Now I am stuck on this. I think it is not that diffucult but some way some how i cannot find the way to remove the side bar.

    So please… please can someone point me in the right direction?? I use the Astra theme!!

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

  • vapvarun
    Participant

    @vapvarun

    @havealookhere inside the child theme create buddypress.php based on page.php and remove sidebar codes from it to make it full width, you can wrap it with conditional to keep it limited for members directory only.


    havealookhere
    Participant

    @havealookhere

    ok, is there an example somewhere about the conditional wrapping???

    And, I place the buddypress.php straight into my childtheme or in childtheme/buddypress/

    thanks for this reply


    havealookhere
    Participant

    @havealookhere

    Because a lot of people search for this i post my sollution here.

    To have some pages of buddypress with a sidebar and some not you can do this! copy page.php into a new file and call it buddypress.php. Then upload it to your childtheme folder.

    Then where the sidebar is called change the get_sidebar() into:

    <?php 
        
        if ( is_page( array( 'spreekkamers', 'forums', 'activiteiten', '0' ) ) ) :
            get_sidebar();
        endif;
    ?>

    In this array you can write the names of the pages you want to have a sidebar shown.

    For the my profile page I used page id 0 because that was the only possibility to get the sidebar on the profile page. This is because its connected to the members page. I did not want a sidebar on the memberspage.

    Then a little of css will make the site look good again.

    In my case it was this css, because it was only about one page:

    body.page-id-3139 div#primary {
        max-width: 100% !important;
        width: 100% !important;
    }

    Thank you vapvarun for pointing me to the right way!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar