remove admin menu from front end

To remove admin menu(featured from wordpress 3.1) for all other user except admin, put the following code into function.php file

<?php
//hide the Admin Bar for all users except Administrators
function my_function_admin_bar($content) {
    return ( current_user_can("administrator") ) ? $content : false;
}
add_filter( 'show_admin_bar' , 'my_function_admin_bar'); 
?>

Comments

comments

Leave a Reply