How to remove admin bar from wordpress frontend user account?

Home Forums WordPress How to remove admin bar from wordpress frontend user account?

This topic contains 1 reply, has 2 voices, and was last updated by  Sushmita Ghosh 6 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #776

    Sushmita Ghosh
    Keymaster

    How can I remove the black color admin top bar from the front-end users account. I want this admin bar to be visible to only administrators.

    #780

    Sushmita Ghosh
    Keymaster

    Add the below code at the bottom of function.php file

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

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

You must be logged in to reply to this topic.

Pasham Technology © 2018 Pasham Technologies