WordPress Admin Bar Not Showing On Front End For Custom Theme
Wordpress is the world's best CMS for websites.

WordPress Admin Bar Not Showing On Front End For Custom Theme

Some custom wordpress theme doesn’t show the admin bar into the theme page same with the wp_head() and the wp_footer() wrote on the templates files. To resolve that problem just add the following code into your function.php or into your own plugin:

function admin_bar(){

  if(is_user_logged_in()){
    add_filter( 'show_admin_bar', '__return_true' , 1000 );
  }
}
add_action('init', 'admin_bar' );

Source: https://www.ahmadmushtaq.com/wordpress-admin-bar-not-showing-on-front-end-for-custom-theme/

要查看或添加评论,请登录

Ahmad Mushtaq , MBA的更多文章

社区洞察

其他会员也浏览了