Hide top admin panel for non admin and non editors

This is what i am using; add_action(‘init’, ‘blockusers_init’); function blockusers_init() { if (is_admin() && !current_user_can(‘administrator’) && !(defined(‘DOING_AJAX’) && DOING_AJAX)) { wp_redirect(home_url()); exit; } } It’s possible the best one. EDIT : You need a custom login page for reach wp-admin. This code redirect to homepage if you enter directly to wp-admin.

WordPress private post won’t display to other admins

The solution I found is in the pre_get_posts function: I added: if ( is_user_logged_in() ) { $query->set( ‘post_status’, array(‘private’, ‘publish’)); } Full code for function: /*——- START add webinars custom post type to the main query loop———-*/ add_filter(‘pre_get_posts’, ‘query_post_type’); function query_post_type($query) { if( is_category() ) { $post_type = get_query_var(‘post_type’); // show private posts to admins … Read more