BuddyDev

Search

Disable BuddyPress Admin Bar and remove CSS blank on member page

  • Participant
    Level: Initiated
    Posts: 10
    Alexandre Brunet on #11284

    Hi Buddy heroes,

    I following up on this question https://buddydev.com/support/forums/topic/feature-image-upload/#post-11282 about disabling Admin Bar and Blank Css on top of Buddypress managed pages.

    I thought it was solved but my bad the issue is still there on members page.

    As described in the former post I added in my theme function.php the following code

    ‘ add_action( ‘init’, ‘remove_admin_bar_user’, 10001 );
    function remove_admin_bar_user() {

    if ( current_user_can( ‘administrator’ ) || is_admin() ) {

    show_admin_bar( true );
    } else {
    show_admin_bar( false );
    }
    }’

    It worked for the forum page but not for the member page any clue about what to do to change this ?

    Many thanks and sorry for reopening the cold case.

    Cheers,

    Alex

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #11285

    Hello Alexandre,

    Sorry for the inconvenience. But i have tested the code on local and it is working fine. Can you point me to the site sothat I can check.

    Thank You
    Ravi

  • Participant
    Level: Initiated
    Posts: 10
    Alexandre Brunet on #11286

    Hi Ravi,

    I’m currently bulding the website on local also so it’s not yet online (will put it in few days). In the meantime as I’m using salient theme and that I put this code in the salient function.php, do you think it should be put somewherelse ?

    Many Thanks,

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #11287

    Hello Alexandre,

    Thank you for this acknowledgment. Just test this code after switching to other WordPress default theme. There might be chances that salient theme playing with admin bar thing. Please and let me know if the issue still persists or not.

    Thank You
    Ravi

  • Participant
    Level: Initiated
    Posts: 10
    Alexandre Brunet on #11311

    Hi Ravi,

    I’m quickly following up on this.

    I updated Salient to 8.5 and the code you proposed then didn’t work on any pages. So it’s definitely related to the theme specification. so I search a bit and found this code

    ‘add_action(‘after_setup_theme’, ‘remove_admin_bar’);

    function remove_admin_bar() {
    if (!current_user_can(‘administrator’) && !is_admin()) {
    show_admin_bar(false);
    }
    }’

    Which is doing the job as far as WP admin bar is concerned. Also there is no blank on the top except for the profile page. Any clue why only the profile page is keeping this blank?

    Many thanks,

    Alex,

You must be logged in to reply to this topic.

This topic is: not resolved