I making a widgetized footer with three widgetized areas (footer1, footer2, footer3), The problem is that even if there's no widgets assigned to any widgetized footer area, the footer is still there with his black background! what I want is to remove the footer if there isn't any widget assigned.
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
I would use the
That way, you can conditionally output the styled container itself. |
|||
|
|
|
I tried this solution but it doesn't work at all!
if( !dynamic_sidebar('footer1') || !dynamic_sidebar('footer2') || !dynamic_sidebar('footer3') ) {
// Do nothing
} else {
// Display the footer
}
Thanks to Chip Bennett His solution works fine, I used it like that:
<?php if( is_active_sidebar('footer1') || is_active_sidebar('footer2') || is_active_sidebar('footer3')) {
?>
<div class="footer">
</div>
<?php } ?>
|
||||
|
|