In my web site the blog section created in word press, I want to hide the META widget to guest users, but it should be displayed in admin . I found the code in sidebar.php( wp-co开发者_高级运维ntent/themes/sidebar.php) page, but i don't know how to display this widget only for admin?
Please any one help me!!!!
You can determine if the current user is an administrator by checking if they have access to one of the admin-only privileges:
if ( current_user_can('manage_options') ) {
//code to display your widget
}
精彩评论