Keeping users out of admin
Hi,
I found this code on the internet for keeping users out of the admin of wordpress. But when I put it in the functions.php I get an error message. Could someone let me know what would come before and after this code so I know exactly where to put it.
add_action( 'admin_init', 'redirect_non_admin_users' ); /** * Redirect non-admin users to home page * * This function is attached to the 'admin_init' action hook. */ function redirect_non_admin_users() { if ( ! current_user_can( 'manage_options' ) && '/
wp-admin/admin-ajax.php' != $_SERVER['PHP_SELF'] ) { wp_redirect( home_url() ); exit; } }
I an using the ClassiPress Theme. Thank you.