This topic has 8 replies, 4 voices, and was last updated 8 years by Laura.

  • Author
  • #35415
     wisinyyandel7
    Participant

    is there any plugin to hide admin bar for guests or visitors? I have read some posts from people and one of them is this one : Global Hide/Remove Admin Bar Plugin, but it hides the admin bar for roles..how about those ones that don’t have roles? like visitors? customers?

    #35508
     Laura
    Moderator

    Hello 🙂 check this one https://wordpress.org/plugins/hide-admin-bar-from-non-admins/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #35510
     Kamal
    Moderator

    Hi,
    To remove admin bar for subscriber or guest, add the following code

    COPY CODE
    
    add_action('set_current_user', 'SweetDate_hide_admin_bar_subscriber');
    function SweetDate_hide_admin_bar_subscriber() {
      if (!current_user_can('edit_posts')) {
        show_admin_bar(false);
      }
    }
    

    to the functions.php of SweeyDate Child theme. You can find it Appearance>Editor>functions.php

    If you want to Disable Admin Bar for All Users Except for Administrators,
    then add the following code

    COPY CODE
    
    add_action('after_setup_theme', 'SweetDate_remove_admin_bar');
    function SweetDate_remove_admin_bar() {
     if (!current_user_can('administrator') && !is_admin()) {
        show_admin_bar(false);
     }
    }
    
    

    to the functions.php and save. I hope this helps you.
    Thanks,
    Kamal

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #35512
     Kamal
    Moderator

    And Sorry @Laura, I did not see you replied first. I was writing reply and you posted in that time. 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #35514
     Laura
    Moderator

    2 answers double help 😉 Dont worry @Kamal

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #104881
     jsw548
    Participant

    Hi

    I tried adding these snippets to functions.php and it did not work.

    I want to hid the black wp admin-bar at the top for all but administrator users and I especially want to hide it from non-logged in users.

    It is the bar that has the below links when no one is logged in:
    About WordPress
    Log in
    Register

    Thanks
    David

    #105153
     Laura
    Moderator

    Hello, try maybe https://es.wordpress.org/plugins/hide-admin-bar-from-non-admins/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #105164
     jsw548
    Participant

    Thanks, that did it!
    David

    #105247
     Laura
    Moderator

    Great 😀

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?