BuddyDev

Search

Hidding avatar from logged out user

  • Participant
    Level: Initiated
    Posts: 3
    Pierre Laroche on #26480

    Hi, iM, trying to hide the avatar in main navigation bar from logged out users
    i have this from now and i’m stuck 😉

    // hidding avatar from logged out users
    function bphelp_remove_avatar_for_logged_out_visitors() {
    if ( ! is_user_logged_in() ) {
    ?>
    <style type=”text/css”>
    .main-navigation .navbar-nav–buddypress {
    display: none;
    }
    </style>
    <?php
    }
    }
    add_action (‘bp_head’, ‘bphelp_remove_avatar_for_logged_out_visitors’);
    ?>

    I put it in bp-custom, thank you for any help!

  • Keymaster
    (BuddyDev Team)
    Posts: 24636
    Brajesh Singh on #26512

    Hi,
    Welcome to BuddyDev forums.

    can you please share the screenshot. From the above code it is not clear what the code is trying to hide and where.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 3
    Pierre Laroche on #26521

    Hello,
    yes sure, i may be a template probleme also and i will investigate on that to, but here’s a screen shot
    …ops, can’t see where i can put a screen shot 😉

  • Keymaster
    (BuddyDev Team)
    Posts: 24636
    Brajesh Singh on #26539

    Hi,
    Thank you for the reply.

    you can use a service like
    https://postimages.org/
    or imgur

    and share the link here.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved