Site logo

[Resolved] Page unaffected to all methods of removing sidebar

Home Forums Support [Resolved] Page unaffected to all methods of removing sidebar

Home Forums Support Page unaffected to all methods of removing sidebar

  • This topic has 3 replies, 2 voices, and was last updated 3 years ago by David.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2570882
    Carsten

    Hi there, I want to have no sidebar on my BuddyPress register page, so members content is not exposed for logged out users.

    The Layout of the page is set to No sidebars, and I even added this code to remove the sidebar, but nothing helps, the sidebar is still there. The id is correct, and I have also tried the page slug ‘register’ as well.

    Why is this page alone totally unaffected to all methods?

    Regards
    Carsten

     add_filter( 'generate_sidebar_layout', function( $layout ) {
         
        if ( is_page(34311) ) {
            return 'no-sidebar';
        }
           // Or else, set the regular layout
        return $layout;
     } ); 
    	
    #2571015
    David
    Staff
    Customer Support

    Hi there,

    try:

    
     add_filter( 'generate_sidebar_layout', function( $layout ) {
         
        if ( bp_is_register_page() ) {
            return 'no-sidebar';
        }
           // Or else, set the regular layout
        return $layout;
     } ); 
    
    #2571286
    Carsten

    Hi there, thanks a lot for the snippet, finally the sidebar is gone from the page. But I wonder why the ID did not work on that page?

    #2571325
    David
    Staff
    Customer Support

    Because BuddyPress swaps it out for its own template 🙂

    Glad to hear its working.

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