- This topic has 10 replies, 2 voices, and was last updated 5 years, 8 months ago by
Leo.
-
AuthorPosts
-
September 16, 2017 at 8:44 am #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
BinuSeptember 16, 2017 at 8:18 pm #386675Leo
StaffCustomer SupportHi there,
Can you link me to the page? Would CSS solution work for you?
Let me know.
September 16, 2017 at 8:45 pm #386694Tom
Lead DeveloperLead DeveloperYou 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; }September 17, 2017 at 3:12 am #386782Binu
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
September 17, 2017 at 9:57 am #386961Tom
Lead DeveloperLead DeveloperAh, 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; }September 17, 2017 at 7:04 pm #387136Binu
Thanks a lot for the help ,Tom. It solved my issue and everything works fine now.
Binu
September 18, 2017 at 12:18 am #387202Tom
Lead DeveloperLead DeveloperYou’re welcome 🙂
June 27, 2020 at 9:50 am #1343823Jeffrey
tried using this code today, does it still work with the newest version?
edit: still works 😉
June 27, 2020 at 12:32 pm #1343905Leo
StaffCustomer SupportYup it should still work 🙂
June 28, 2020 at 6:28 am #1344371Jeffrey
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?
June 28, 2020 at 9:31 am #1344641Leo
StaffCustomer SupportCan you open a new topic for your question and link us to the page in question?
-
AuthorPosts
- You must be logged in to reply to this topic.