actions - Manually add admin bar

Does anyone know how to include the admin bar in a page template where wp_head() and wp_footer() are not present? I'

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
  • 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 Commented Sep 5, 2014 at 20:34
Add a comment  | 

2 Answers 2

Reset to default 0

From 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

相关推荐

  • actions - Manually add admin bar

    Does anyone know how to include the admin bar in a page template where wp_head() and wp_footer() are not present? I'

    10小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信