I'm just trying to turn off the wp admin bar on one page, but this function removes it from every page. What am I missing?
<?php
if ( !is_page('image-upload') ):
show_admin_bar(false);
endif;
?>
|
I'm just trying to turn off the wp admin bar on one page, but this function removes it from every page. What am I missing?
|
|||||||||||
|
|
You need to remove the (!) infront of the conditional, you can read about PHP-operators here. Now you simply say that if not on page "image-upload" remove the admin_bar.. Here is the working code:
Just an example to understand the conditional:
|
|||||||||||
|
Hide Admin Bar for everyoneThis one is reasonably simple, to hide the WordPress Admin Bar for everyone, add the following to your theme’s
Hide WordPress Admin Bar for specific requests
This would allow you to hide the WordPress admin bar by going to To hide the WP Admin Bar and the Admin Bar preference on his/her profile page for a specific user, add the following to your theme's
Or you could do the reverse, and enable the WordPress Admin Bar just for one user, by disabling it for everyone else:
|
|||||||
|
|
It should be
remove '!' from !is_page |
|||
|
|