How can I hide the admin panel from my wordpress theme site during login to customize it?

I am new to wordpress. I need help here, I want to remove the Wordpress admin panel from my site, but not from the admin panel, to see how my site will look while I publish.

How can i do this?

+3


source to share


2 answers


From the theme directory, open the function.php file and add the below code. Hope your problem is solved.



add_filter('show_admin_bar', '__return_false');

      

+1


source


If you want to hide it for all users, paste this code in your theme's functions.php.

add_action('after_setup_theme', 'remove_admin_bar');

function remove_admin_bar() {
    if (!current_user_can('administrator') && !is_admin()) {
     show_admin_bar(false);
    }
}

      



Or if you want to hide it for all users except admin then you need to add this code to funtions.php

show_admin_bar(false);

      

+1


source







All Articles