WordPress - How to know if a sidebar is empty without loading it?

Posted by Relax on Stack Overflow See other posts from Stack Overflow or by Relax
Published on 2010-03-18T09:55:25Z Indexed on 2010/03/18 10:11 UTC
Read the original article Hit count: 351

Filed under:
|
|

I'm trying to wrap the sidebar by a DIV, and if the sidebar is empty the DIV should not be displayed

But i cannot use codes like

if(dynamic_sidebar(1))
{
  echo '<div>';
  dynamic_sidebar(1);
  echo '</div>';
}

as it will load the sidebar before the DIV if it is not empty, any ideas?

© Stack Overflow or respective owner

Related posts about Wordpress

Related posts about wordpress-theming