最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Load admin bar without wp_head or wp_footer

programmeradmin2浏览0评论
This question already has answers here: Manually add admin bar (2 answers) Closed 5 years ago.

Is there any possible way to load admin bar without wp_head or wp_footer? If no, so maybe there is a way to load wp_head() or wp_footer() to catch only admin bar functions, styles and scripts? Is this even possible in worpdress?

For example: wp_head(load_admin_bar()); or something like that.

Thanks for any answers.

This question already has answers here: Manually add admin bar (2 answers) Closed 5 years ago.

Is there any possible way to load admin bar without wp_head or wp_footer? If no, so maybe there is a way to load wp_head() or wp_footer() to catch only admin bar functions, styles and scripts? Is this even possible in worpdress?

For example: wp_head(load_admin_bar()); or something like that.

Thanks for any answers.

Share Improve this question edited Jun 21, 2017 at 11:30 Tauras asked Jun 21, 2017 at 11:19 TaurasTauras 1235 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 1

Looks like, the only solutions which worked was to call admin bar directly.

if (current_user_can('administrator') || current_user_can('editor')) {
 wp_admin_bar_render();
}
发布评论

评论列表(0)

  1. 暂无评论