Site logo

Archived topic

How can I show the left menu on buddypress?

16 replies · Started by Lim on May 22, 2021

Viewing posts 1–15 of 17

Long time ago I asked for this "How can I show the left menu on buddypress?"

You give me this code

add_filter( 'generate_sidebar_layout', function( $layout ) {
if ( function_exists( 'is_buddypress' ) && is_buddypress() ) {
return 'left-sidebar';
}

return $layout;
} );

but right now
this code is not working.

Can you check this code?
and please make me the snippet code.

Hi there,

That code just gives the buddypress pages a left sidebar.

Are you trying to show the primary navigation there?

Let me know :)

Hi.

I am beginner. so I don't understand.

could you tell me more detail.

" Are you trying to show the primary navigation there? "
what is the meaning?

I attached image I set in my admin menu.

Hi Lim,

Like Leo mentioned, the snippet you've provided allows BuddyPress pages to display left sidebar.

What this implies is, by default, GeneratePress doesn't display left sidebar on BuddyPress pages so you must add that PHP snippet so the sidebar appears on BuddyPress pages.

Now to Leo's other question "Are you trying to show the primary navigation there?.

He's asking if you want to place a navigation menu on the left sidebar once you're able to display it on BuddyPress pages.

Is this what you're trying to do? Let us know.

Hello, I'm a foreigner. Also, I don't know PHP at all. So I always have communication problems with technical problems.

I want to attach the left menu to my buddy press.

But the snippet code Tom provided a long time ago doesn't work strangely.

How can I show the left menu on Buddy Press?

I want you to make a new code because the code I sent you is not working.

this is the image that I want to make.

Where does the menu come from? Is it a widget? If so, have you added it in the "Left Sidebar" widget area in "Appearance > Widgets"?

Tom. hi

yes!

My left side bar menu is from My widget.

I made widget and add the link to buddypress profile.

when i click the link to buddypress, there is no left side bar menu in my buddypress.

How to add the buddypress with the widget left side bar?

Left side bar in widget - buddypress profile

Hi there,

Sorry for the delay here.

I just logged in and took a look around, but I'm having trouble finding the page where you want the sidebar to appear. Can you link me to the specific page where you're expecting/wanting it to show up?

Thanks!

I wrote this.

BuddyPress has quite a few different conditions for different areas, unfortunately.

For the Activity area, you could try this:

add_filter( 'generate_sidebar_layout', function( $layout ) {
    if ( function_exists( 'bp_is_activity_component' ) && bp_is_activity_component() ) {
        return 'left-sidebar';
    }

    return $layout;
} );

Hi. Tom

I made the snipet code you made right before.

But it didn't work.

I know that BuddyPress has quite a few different conditions for different areas.

please check and help me once more.

I am still using the code you made in my site currently.

As always. Thank.you.

Hi

I am using this code.
------------------------------
add_filter( 'generate_sidebar_layout', function( $layout ) {
if ( function_exists( 'bp_is_activity_component' ) && bp_is_activity_component() ) {
return 'left-sidebar';
}

return $layout;
} );
-----------------------------

please check
one page has left sidebar
others pages have not left sidebar

I just installed BuddyPress and ran some tests for conditions.

This function ended up working everywhere that's using BuddyPress:

add_filter( 'generate_sidebar_layout', function( $layout ) {
    if ( function_exists( 'is_buddypress' ) && is_buddypress() ) {
        return 'left-sidebar';
    }

    return $layout;
} );

The result is this: https://www.screencast.com/t/ImE7Ty0aA

This archived topic is closed to new replies.