I have a post type/single page that I'm using to create iframe widgets for embedding on other sites and blogs. The admin bar code is creating that extra 28px space at the top, and if I try to include it in a wordpress text widget, it screws with the existing admin bar on the hosting site for the iframe. I'm using a custom single and custom header file, wondering how I can lose the bar and css associated with it entirely just for that content. Thanks! (also posted on wordpress.org)
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
You can add some code into your theme's functions.php file that checks the post type or whatever condition you want and when the condition is met, add this filter:
See this codex page for more information: http://codex.wordpress.org/Plugin_API/Filter_Reference/show_admin_bar |
|||
|
if ( isset($_GET['bar']) && 'no' == $_GET['bar'] ) add_filter( 'show_admin_bar', '__return_false' );"This would allow you to disable the WordPress admin bar by going to example.com/?bar=no, you can of course change those values." documentation: yoast.com/disable-wp-admin-bar This will work for my purposes, but requires a custom url. if anyone has any alternate suggestions, I'd be interested. – Wendy Nov 29 '11 at 21:37