[Resolved] Making BuddyPress profile page full-width

Home Forums Support [Resolved] Making BuddyPress profile page full-width

Home Forums Support Making BuddyPress profile page full-width

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #386511
    Binu

    Hi,
    I would like to remove/hide sidebar from Buddypress user profile page to display it full-width.
    Is there any easy way to do that? I am using G P child theme.
    I have heard about using custom template; but not sure whether it will serve my purpose,as I am looking forward to modifying only user profile page.

    Thanks
    Binu

    #386675
    Leo
    Staff
    Customer Support

    Hi there,

    Can you link me to the page? Would CSS solution work for you?

    Let me know.

    #386694
    Tom
    Lead Developer
    Lead Developer

    You should just be able to use the generate_sidebar_layout filter: https://docs.generatepress.com/article/generate_sidebar_layout/

    For example:

    add_filter( 'generate_sidebar_layout', 'tu_buddypress_sidebars' );
    function tu_buddypress_sidebars( $sidebar ) {
        if ( function_exists( 'is_buddypress' ) && is_buddypress() ) {
            return 'no-sidebar';
        }
    
        return $sidebar;
    }
    #386782
    Binu

    Thank you Tom & Leo for the responses.
    The code suggested by Tom removes sidebars from all the BuddyPress pages . In fact ,I just want to remove sidebar from “member profile page” only, not from other BuddyPress pages such as “Groups,Activity& Members.

    I understand that ,member profile page is dynamically generated,and such a page does not appear in the pages directory under dashboard.

    Is it possible to display full with page without sidebar only for buddypress user/member profile page ,using php code or CSS?

    Thanks

    Binu

    #386961
    Tom
    Lead Developer
    Lead Developer

    Ah, try this instead:

    add_filter( 'generate_sidebar_layout', 'tu_buddypress_profile_sidebars' );
    function tu_buddypress_profile_sidebars( $sidebar ) {
        if ( function_exists( 'bp_is_user_profile' ) && bp_is_user_profile() ) {
            return 'no-sidebar';
        }
    
        return $sidebar;
    }
    #387136
    Binu

    Thanks a lot for the help ,Tom. It solved my issue and everything works fine now.

    Binu

    #387202
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

    #1343823
    Jeffrey

    tried using this code today, does it still work with the newest version?

    edit: still works πŸ˜‰

    #1343905
    Leo
    Staff
    Customer Support

    Yup it should still work πŸ™‚

    #1344371
    Jeffrey

    Is there a way to make the profile not stretch too far to the edges. It works, but distorts the pages making them too close to the edges of the screen.

    Is there a way to put some space (margin) on the side. However keep the cover image at full width?

    #1344641
    Leo
    Staff
    Customer Support

    Can you open a new topic for your question and link us to the page in question?

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.