Can't apply Custom Sidebars to Buddypress Groups

Hi

Buddypress Groups are using the sidebar for Pages, eg:

http://digitalscot.net/groups/fintech/

When I go into Custom Sidebars > Sidebar that I want, there is no option to assign a Buddypress Group as the content type to associate it with. Why would Groups not be included in this list?

Thanks, Neil.

  • Patrick Freitas
    • Staff

    Hi Neil McEvoy

    How are you today?

    I think we can use this workaround to try to help, first of all, I suggest we work using mu-plugin which are plugins installed in a special directory inside the content folder and which are automatically enabled on all sites in the installation, it will avoid that any update of the Theme will not replace our custom function. You can find more information on the WordPress codex: https://codex.wordpress.org/Must_Use_Plugins

    To solution:

    – Create a file for example “my-workaroud.php” in the folder wp-content/mu-plugins, if the folder mu-plugins doesn’t exist, please create it as well.

    – Edit the previous created file and paste this code:

    add_action('wp', 'set_sidebar', 10);
    function set_sidebar() {
    global $_wp_sidebars_widgets, $bp;
    switch( $bp->groups->current_group->id ) {
    case 1:
    $_wp_sidebars_widgets['REPLACEABLE SIDEBAR ID'] = $_wp_sidebars_widgets['REPLACED SIDEBAR ID'];
    break;
    case 2:
    $_wp_sidebars_widgets['REPLACEABLE SIDEBAR ID'] = $_wp_sidebars_widgets['REPLACED SIDEBAR ID'];
    break;
    case 3:
    $_wp_sidebars_widgets['REPLACEABLE SIDEBAR ID'] = $_wp_sidebars_widgets['REPLACED SIDEBAR ID'];
    break;
    }

    }

    You can expand this code as many you need to, just keep using the same syntax for example.

    ...case 4:
    $_wp_sidebars_widgets['REPLACEABLE SIDEBAR ID'] = $_wp_sidebars_widgets['REPLACED SIDEBAR ID'];
    break;
    }...

    REPLACEABLE SIDEBAR ID – You will replace this with the Sidebar ID which can be found using inspect element of the browser.

    Now the sidebar will be assigned to your Buddypress Groups.

    Let me know for any further question.

    Have a great day,

    Patrick Freitas

  • Neil McEvoy
    • The Incredible Code Injector

    Hi Patrick

    Many thanks, but before starting on that, I thought it would be helpful to see what the theme owner suggested, which is pasted below.

    I’m not a theme hacker, so I have no idea how to do this. Is there a non-techie option for implementing it, or even if it’s quick enough could you guys pop on and action it? Support access is enabled on digitalscot.net if needed.

    “Use following css:

    #sidebar #bp_core_members_widget-5 {display:none }

    .single-item.groups #sidebar #bp_core_members_widget-5 { display:block; }

    You have to change unique id of widget – #bp_core_members_widget-5, unique id you can find browsing code source in web browser.”

  • Neil McEvoy
    • The Incredible Code Injector

    For example, I also asked how to modify the top banner across every page, to which they said… so maybe I could repeat this for the above too?

    “Go to appearance -> customize -> additional css and paste following css

    .header-title { width:100%; padding:20px 0 20px 0; }

    .page-title { font-size:40px; }”

  • Patrick Freitas
    • Staff

    Hi Neil McEvoy

    How are you?

    I was doing some further research, I would like apologies, I may be confused for what you pretend to do, would you mind please to write more about what you would like to do and maybe send some screenshot with examples, just to be sure that we are talking about same subject.

    Once replied I can see what is the best option for you.

    Have a Great day,

    Best Regards,

    Patrick Freitas

  • Neil McEvoy
    • The Incredible Code Injector

    Hi Patrick

    I mistakenly started a new ticket for this same issue, and one conclusion was that I thought I was being told by the theme owner that those modifications would solve my need, but actually it doesn’t do that at all. So I do need your solution.

    My challenge is that it’s way beyond my technical capabilities. I will have to hire a tech etc.

  • Patrick Freitas
    • Staff

    Hi Neil McEvoy

    Wouldn’t you mind please to send me the FTP information and I can have a closer look on this.

    I checked and Custom Pro do not supports Buddypress Group, so that code should be a workaround that I found in a past thread, however, you can send me the information and I can have a closer look and see if I get a solution to your problem.

    Also you can open a new ticket for Features & Request for Custom Sidebar pro allows Buddypress Group on the filter, and if it becomes popular can be considered as feature on a future release.

    Note: Don’t leave your login details in this ticket.

    Instead, you can send us your details using our contact form https://premium.wpmudev.org/contact/#i-have-a-different-question:

    Subject: “Attn: Patrick Freitas”

    – Site login URL

    – WordPress admin username

    – WordPress admin password

    – FTP credentials (host/username/password)

    – cPanel credentials (host/username/password)

    – Folder path to site in question

    – Link back to this thread for reference

    – Any other relevant urls/info

    Please, let me know when you send the information.

    Have a great day,

    Patrick Freitas

  • Neil McEvoy
    • The Incredible Code Injector

    Hi Patrick

    The credentials are definitely correct, but I never use it for ftp, that’s beyond my skills, I only use it for ad-hoc command line stuff. However I have a tech firm do that for me and they assure you can use it for the ftp you need, so maybe it’s a question of a specific how to kinda thing. I will ask them.

    Also support access will still be active it was only a day or two ago.

    cheers Neil.

  • Neil McEvoy
    • The Incredible Code Injector

    Hi Patrick:

    Our server currently using sftp to connect the server and default port is 22 to connect the server.

    If you are unable to connect the server then please use the following method to connect the server.

    Method 1:

    Could you please find the cloud_site.xml file and import into ftp application and connect the server.

    Method 2:

    You can use the following login details to connect the server.

    Login details was sent by email***

    Please, select protocol type is sftp.

  • Patrick Freitas
    • Staff

    Hi Neil McEvoy

    Sorry for delay here. I made some test and the customisation will need to be extended to a custom modification on Theme Structure and BuddyPress, you will need to customise the buddypress sidebar and create some function to call the widget.

    I’m afraid that this will require some work to be done.

    Please check the support section.

    https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-1

    However I suggest you open a Feature & Request for Custom Sidebars Pro to include BB Group on it, the members can vote and it can be considered on a future release.

    You can also post this customisation needed on the Jobs and Pos page: https://premium.wpmudev.org/wordpress-development/

    note there aren’t WPMU DEV staffs involved there.

    Best Regards

    Patrick Freitas

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.