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
Post a Comment