How can we help?

If you are looking for support for our Poka theme, this is the place!

Home Forums Poka support Admin Bar not showing

This topic contains 3 replies, has 2 voices, and was last updated by  admin 1 year, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #462

    Josh Lingenfelter
    Participant

    Hi

    I’ve installed the theme however the admin bar on the front end doesn’t display on any of the pages.

    What do i need to do to fix this?

    Thanks

    #463

    admin
    Keymaster

    Hi Josh!

    Because admin bar is disabled by default in the theme, you can do the following:

    In your child theme functions.php add:

    function poka_child_setup(){
    
        add_filter( 'show_admin_bar', '__return_true', 100 );
        
    }
    
    add_action( 'after_setup_theme', 'poka_child_setup' );

    And then enable the Poka child theme in your Appearance menu.

    #474

    Josh Lingenfelter
    Participant

    Hi

    That seems to of solved it, however it shows all the time now even if you’re not logged in, how do i set it so its only visible to users.

    Thanks

    #475

    admin
    Keymaster

    Hi Josh!

    If you want to show the bar only to logged in users :

    function poka_child_setup(){
    
        if ( is_user_logged_in() )
            add_filter( 'show_admin_bar', '__return_true', 100 );
        
    }
    
    add_action( 'after_setup_theme', 'poka_child_setup' );
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.