Just a quick way of hiding the Wordpress admin bar without having to go into the User Settings or turning it off completely. Just add ?nowp
to the URL and it's gone. Easy preview without the menu. Especially useful when you have fixed elements like a header which can end up behind this bar
<?php
add_action('wp', 'hide_admin_bar_if_nowp');
function hide_admin_bar_if_nowp() {
if (isset($_GET['nowp'])) {
add_filter('show_admin_bar', '__return_false');