WordPress Customizer not setting default value upon initial install?

I’ve managed to fix this by changing the operator on the ‘if’ statement:

Original:

?>
<style type="text/css">
 <?php if( get_theme_mod( 'facebooklink_edit' )  ==  '' ) { ?>
   #fb-footer-bg { display: none; }
 <?php } // end if ?>
</style>
<?php

Updated:

?>
<style type="text/css">
<?php if( get_theme_mod( 'facebooklink_edit' )  ===
    #fb-footer-bg { display: none; }
<?php } // end if ?>
</style>
<?php

Changing ‘is equal to’ to ‘is identical’ seems to fix this.

Leave a Comment