Support » Developing with WordPress » Remove ‘my site’ with dashbord in admin bar

  • Resolved kroesjeluc

    (@kroesjeluc)



    Hello,

    I’ve searched the whole forum for an answer but i cant find it.
    I want to delete this part of my Admin_bar (see image)

    http://imgur.com/a/bRb1c
    (the sitetitel with the dropdown to dashboard, next to the wordpress logo in the Admin_bar)

    I dont mind if it is there when im logged in as admin. But as a normal user i just want it to be gone.

    Can anyone help me?

    • This topic was modified 1 year, 7 months ago by  kroesjeluc.
    • This topic was modified 1 year, 7 months ago by  kroesjeluc.
    • This topic was modified 1 year, 7 months ago by  kroesjeluc.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Simplest approach would be to hide with CSS:

    #wp-admin-bar-site-name {
        display: none;
    }

    OK, there are 2 options.

    Option #1

    if you want to disable the whole admin bar for all users then just add this line to your functions.php file :

    add_filter('show_admin_bar', '__return_false');

    Options #2
    if you want just hide the site name ad keep the admin bar, then hide it with CSS is simplest way :P, add this code to your style.css file

    #wp-admin-bar-site-name { display:none !important;}

    Hope this help 😉

    And here’s a PHP approach as well:

    function my_prefix_remove_admin_bar_item( $wp_admin_bar ) {	
    	$wp_admin_bar->remove_node('site-name');
    } add_action( 'admin_bar_menu', 'my_prefix_remove_admin_bar_item', 999 );

    thanks for your respons guys. It worked! biglove

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove ‘my site’ with dashbord in admin bar’ is closed to new replies.