Site logo

Archived topic

Making BuddyPress profile page full-width

10 replies · Started by Binu on September 16, 2017

Viewing posts 1–11 of 11

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

Hi there,

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

Let me know.

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;
}

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

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;
}

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

Binu

You're welcome :)

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

edit: still works ;)

Yup it should still work :)

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?

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

This archived topic is closed to new replies.