Last active
December 18, 2015 01:18
-
-
Save alana-mullen/5702265 to your computer and use it in GitHub Desktop.
Disable the WordPress Admin Bar on mobiles but enable on desktops for logged in users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Disable the admin bar on mobiles but enable on desktops | |
function cornerstone_show_admin_bar() { | |
if( wp_is_mobile() || !is_user_logged_in() ) { | |
return false; | |
} else { | |
return true; | |
} | |
} | |
add_action( 'show_admin_bar' , 'cornerstone_show_admin_bar'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment