[wp-hackers] Displaying a sidebar only if it contains widgets

Philip M. Hofer (Frumph) philip at frumph.net
Fri Oct 8 15:59:12 UTC 2010


the function is_active_sidebar('sidebarname') can be used, it returns true 
if there's a widget inside and active inside

if (is_active_sidebar('footer')) get_sidebar('footer');


----- Original Message ----- 
From: "David Morris" <dvmorris at gmail.com>
To: <wp-hackers at lists.automattic.com>
Sent: Friday, October 08, 2010 8:55 AM
Subject: [wp-hackers] Displaying a sidebar only if it contains widgets


> Is there an easy way to check if a sidebar contains widgets before
> displaying it?
>
> Thanks,
> Dave
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 




More information about the wp-hackers mailing list