see if this works
add it to your function.php in your child theme or functionality plugin.
/**
* Disable admin bar on the frontend of your website
* for subscribers.
*/
function rkk_disable_admin_bar() {
if( ! current_user_can('edit_posts') )
add_filter('show_admin_bar', '__return_false');
}
add_action( 'after_setup_theme', 'rkk_disable_admin_bar' );
/**
* Redirect back to homepage and not allow access to
* WP admin for Subscribers.
*/
function rkk_redirect_admin(){
if ( ! current_user_can( 'edit_posts' ) ){
wp_redirect( site_url() );
exit;
}
}
add_action( 'admin_init', 'rkk_redirect_admin' );
Hi @Robkk where do I add this code?
@jsantana
i said where in my above reply
add it to your function.php in your child theme or functionality plugin.