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!
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!
Share Improve this question asked Sep 5, 2014 at 19:21 jamiljamil 4764 silver badges9 bronze badges 1 |2 Answers
Reset to default 0From Codex:
<?php show_admin_bar( $bool ); ?>
I think you can get it to work by calling the action that renders the bar in your template like this:
<?php do_action( 'wp_footer','wp_admin_bar_render' ); ?>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745438153a4627706.html
wp_footer()
. javascript and style files needed by the admin bar are enqueued inwp_head()
(or inwp_footer()
if the enqueue order has been modified by a plugin/theme). Not sure if you can easily do what you are trying. – cybmeta Commented Sep 5, 2014 at 20:34