I’m using: get_theme_mod to show various pieces of info from the theme customizer, in the following format:
<a href=" <?php get_theme_mod( $name, $default ) ?> ">This is the link</a>
I would like to hide the whole line if that particular customizer field is empty.
What could I wrap around the anchor to accomplish this?
Looking for an answer to displaying default text in place of a customizer set heading. In a funny roundabout way, thepost by @Otto gave me the idea of checking for an empty string.
Irrespective of your default value in the customizer setting, you could just compare the theme modification value to an empty string:
Test if is not null we will show the content:
If is null we will show nothing.