I'm working on my theme customizer and am trying to find a more efficient way of showing a div

Currently, what works for me is:

(this is the section)

$wp_customize->add_section('social-networks', array(

(and this is what im using to display a div if any options are selected)


  if (    

    ( !empty(get_theme_mod('facebook-link')) ) 


    ( !empty(get_theme_mod('instagram-link')) ) 


    ( !empty(get_theme_mod('linkedin-link')) ) 

) : 


<div class="display-social-div"></div>

<?php endif; ?>

This works, but is there a simpler way to show the div if any of the setting/controls are checked, instead of having to list out each setting/control to see if they are checked? I have about 20 setting/controls and only showed 3 as an example here....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.