WordPress Toolbar: NO SHOW for specific users while on index page -


i show toolbar visitors of site, exception of; not logged in users\visitors, while on index page.

the following placed in function file works fine displaying toolbar visitors @ times.

add_filter( 'show_admin_bar', '__return_true' );

so hoping replacing meet added conditions...

    function show_bar() {          if ( ! isset( $show_admin_bar ) ) {               if ( ! is_user_logged_in() && is_home() ) {                    $show_admin_bar = __return_false;               } else {                    $show_admin_bar = __return_true;           }          }    $show_admin_bar = add_filter( 'show_admin_bar', '$show_admin_bar' );    return $show_admin_bar;     } 

i don't think function being fired (no warnings or errors, no toolbar visitors. ). question is, there better way this, if not take function work?

thx


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -