Collapse Widget Area When Empty
-
I have created 4 custom widget pockets in my footer (_s) and cannot get the space to collapse when all of them are empty. It looks bad and I suspect if I can add the div tag and class before, and the </div> tag after with the php in functions, there must be a way to have it check that all four are empty (have that piece below) and then clear or remove the container div and collapse the space it now fills. I found this code posted in the forum from 5 years ago but nothing more. This makes sense but I can’t figure out the rest of the php, the html and css that would make it all work together.
if ( ! is_active_sidebar( ‘first-footer-widget-area’ )
&& ! is_active_sidebar( ‘second-footer-widget-area’ )
&& ! is_active_sidebar( ‘third-footer-widget-area’ )
&& ! is_active_sidebar( ‘fourth-footer-widget-area’ )
)
return;Any help would be appreciated!
- The topic ‘Collapse Widget Area When Empty’ is closed to new replies.