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 01 Answer
Reset to default 1Looks 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();
}
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745438279a4627710.html
评论列表(0条)