[theme-reviewers] Toolbar on Frontend Question

Justin Tadlock justin at justintadlock.com
Sun Oct 6 16:26:16 UTC 2013


Use:

     if ( is_admin_bar_showing() )
         echo 'true';
     else
         echo 'false';

Or:

     if ( true === is_admin_bar_showing() )
         echo 'true';
     else
         echo 'false';

Or:

     echo is_admin_bar_showing() ? 'true' : 'false';

I think these questions are perfectly fine for a mailing list like 
this.  We are theme developers, after all.  Why not help each other with 
actual code problems once in a while?  It breaks up the routine of 
arguing over every minute detail of what's allowed or not allowed in a 
theme.  It's refreshing.  I'd like to see more of this.


On 10/6/2013 6:41 AM, Ronnel Angelo wrote:
> Why not try.
>
> if ( is_admin_bar_showing() ) {
> echo 'true';
> }
> else {
> echo 'false';
> }
>
> I think question like these are better asked on the support forums and 
> not here on the theme-reviewers.
>
>
> On Sun, Oct 6, 2013 at 7:02 PM, Phillip Wells 
> <phillipwells at hotmail.co.nz <mailto:phillipwells at hotmail.co.nz>> wrote:
>
>     I am currently making a theme and i need to use
>     is_admin_bar_showing(); i have this code below
>     if ( is_admin_bar_showing() ==true ){
>     echo'true';
>     }
>     elseif ( is_admin_bar_showing() == false ){
>     echo'false';
>     }
>     endif;
>
>     However this doesn't work and i am not sure why.
>
>     The description on the codex is: This Conditional Tag
>     <http://codex.wordpress.org/Conditional_Tags> checks if the
>     WordPress Toolbar
>     <http://codex.wordpress.org/Administration_Screens#Toolbar> is
>     being displayed. This is a boolean function, meaning it returns
>     either TRUE or FALSE. and here is a link to the page on the codex
>     http://codex.wordpress.org/Function_Reference/is_admin_bar_showing. I
>     have checked this page but i still cannot figure out how to do it
>     as this page is not very helpful.
>
>     _______________________________________________
>     theme-reviewers mailing list
>     theme-reviewers at lists.wordpress.org
>     <mailto:theme-reviewers at lists.wordpress.org>
>     http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
>
>
> -- 
> http://ronangelo.com
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20131006/26d4ed6b/attachment.html>


More information about the theme-reviewers mailing list