• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

Hide WordPress Admin Bar by Default

July 21, 2011 by Webhead

Problem:

When users register for a site, they are usually just registering to comment on a page.  This means they DO NOT need the admin bar at the top hiding a portion of your page.

 

Solution:

To get rid of this  you can add this to your functions page:

 

// show admin bar only for admins and editors
if (!current_user_can('edit_posts')) {
	add_filter('show_admin_bar', '__return_false');
}

 

More solutions can be found here:

http://digwp.com/2011/04/admin-bar-tricks/

Filed Under: Coding Tagged With: php, wordpress

Primary Sidebar

Topics

apache apple block editor chrome cms css debug eCommerce embed firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery linux localization mac os x ms sql mysql open source optimize php php 5.3 responsive rest api seo svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools