Remove the Admin Bar from WordPress

September 17, 2011

There is a new admin bar add to WordPress 3.x that shows up when you are logged in as a subscriber or above. But if you don’t like it and want to remove it, just paste the following code into your functions.php file, save it and goodbye admin bar. add_filter('show_admin_bar', '__return_false');  Read More →

Remove admin name in wordpress comments class

May 25, 2010

Every time we posted a comment, WordPress automatically added a class that pretty much told everyone our admin login name. The offending class is the “comment-author-admin” class. We can created a code snippet that can quickly remove the offending class from every comment. Just add follow code to your functions.php file: function remove_comment_author_class( $classes ) { foreach( $classes as $key => $class ) { if(strstr($class, "comment-author-")) { unset( $classes[$key] ); } } return $classes; } add_filter(... [Read the full story]

Prevent wordpress admin to be tracked by Google analytics

November 22, 2008

How can we’ll be able to prevent the blog admin from being tracked as a normal visitor by Google Analytics or any other tracking code. We need the current_user_can() WordPress function. This function checks the given parameter, which is the level of the current user, and returns true if the level of the current user is superior or equals to the given parameter. The following code will track any visitor or blog contributor exept the admin, if he’s logged in, of course. <?php if (!current_user_can('level_10')){ ?> INSERT... [Read the full story]

Adding an admin page near “Setting/Plugins/Users”

October 22, 2008

WordPress have a lot of very nice function which allows you to quickly add menu page in the admin dashboard. But sadly, no function was created to add an admin page near the “Setting/Plugins/Users”. Here’s a nice code to easily add an admin page there. This is a function that will create a new admin page near “Setting/Plugins/Users” in your WordPress dashboard. Paste the code below in your functions.php file. define ('TWEAK_MENU_BEGIN', 25); define ('TWEAK_MENU_END', 40); function add_tweak_menu_page($name, $capability,... [Read the full story]

Displaying Content Only For The Admin To See

May 6, 2008

Some code that looks at the user id to determine if the user has admin privileges and then displays whatever you tell it to for that user. Here is the code: <?php global $user_ID; if( $user_ID ) : ?> <?php if( current_user_can('level_10') ) : ?> <a href=”“>Stats</a> <?php else : ?> <?php endif; ?> <?php endif; ?> If you run a multi-author blog and would like to make this stuff available to editors, authors, contributors, and more, you can easily... [Read the full story]