Skip to main content

WP dashboard bar appearing at top

EDIT: I just realized that the below issue only occurs when viewing a Wordpress page that is using the theme compatibility feature.

Just testing out signing up as a user to my community and noticed that when I first signed up and was redirected to the community that the wordpress dashboard bar appeared at the top. The only options it gave me was to visit community portal (which I was already in) or visit dashboard. I clicked "visit community portal" and the bar vanished and has not returned. Is this normal? If so, is there a way to stop that top bar from appearing on first login?

Jason Soper

Fixed this issue by adding a snippet to disable the admin bar for all user roles except admin.

Any One

Is there already a solution for this problem?

Thomas Oates

Any OneΒ This code should do it.

    add_action('after_setup_theme', 'disable_admin_bar');
    function disable_admin_bar() {
        if (current_user_can('administrator') ) {
            show_admin_bar(true);
        } else {
            show_admin_bar(false);
        }
    }