Does anyone know how to include the admin bar in a page template where wp_head() and wp_footer() are not present? I'm developing a template other scripts and styles are just getting in the way. Rather than go through and dequeue all of the stuff I don't need, I've simple removed the two hooks altogether. All I want instead is the admin bar.

Thanks!

  • Admin bar is printed in the wp_footer(). javascript and style files needed by the admin bar are enqueued in wp_head() (or in wp_footer() if the enqueue order has been modified by a plugin/theme). Not sure if you can easily do what you are trying. – cybmeta Sep 5 '14 at 20:34

From Codex:

<?php show_admin_bar( $bool ); ?>
  • You should explain why this fix the problem. If you try to do it you will notice that your answer is not the answer. That function set the status of the admin bar but not print it. – cybmeta Sep 5 '14 at 20:23
  • I have to agree with this comment. This would only work if it was disabled and wp_head() and wp_footer() existed in my code. Thanks for answering though. – jamil Sep 8 '14 at 17:35

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.