If Sidebars Are Active PHP Conditions
-
This is my code below, what I’m trying to do is… IF any of the footer-1, footer-2, OR footer-3 sidebars are active, then display the DIV with the sidebars in it. If not, then don’t display the sidebars with the DIV at all. I tried
if ( is_active_sidebar( 'footer-1', 'footer-2', 'footer-3' ) )
, I’ve also triedif ( is_active_sidebar( array( 'footer-1', 'footer-2', 'footer-3' ) ) )
, and I triedif ( is_active_sidebar( 'footer-1' || 'footer-2' || 'footer-3' ) )
I get errors. So how do I properly add the OR conditions for these three sidebars?<?php if ( is_active_sidebar( 'footer-1' ) ) { ?> <div class="footer-sidebar-wrapper"> <div class="footer-sidebar-container"> <div class="footer-sidebar-left"><?php dynamic_sidebar( 'footer-1' ); ?></div> <div class="footer-sidebar-middle"><?php dynamic_sidebar( 'footer-2' ); ?></div> <div class="footer-sidebar-right"><?php dynamic_sidebar( 'footer-3' ); ?></div> </div> </div> <?php } ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘If Sidebars Are Active PHP Conditions’ is closed to new replies.