wordpress, detecting number of widets inside a div
i am using wordpress and have come at a point that i have to hide the div if开发者_如何学Python there is no widget displayed in it.
can some one tell me the code for detection of number of widgets displayed in a specific area.try this
<?php if ( is_active_sidebar( 'your-widget-area' ) ) : ?>
<!--This div will not display if there is no active widgets
so place your div inside if condition-->
<div>
<?php dynamic_sidebar( 'your-widget-area' ); ?>
</div>
<?php endif; ?>
精彩评论