• Resolved Dane Morgan

    (@dane-morgan)


    Change social media links section to this code and people can leave URIs blank in the customizer for services they choose not to use.

    <?php if( get_theme_mod( 'iconic_one_social_activate' ) == '1') : ?>
            <div class="socialmedia">
                <?php if ( get_theme_mod( 'twitter_url' ) ) : ?>
                    <a href="<?php echo get_theme_mod( 'twitter_url', 'default_value' ); ?>" target="_blank">
                        <img src="<?php echo get_template_directory_uri(); ?>/img/twitter.png" alt="Follow us on Twitter"/>
                    </a>
                <?php endif; ?>
                <?php if ( get_theme_mod( 'facebook_url' ) ) : ?>
                    <a href="<?php echo get_theme_mod( 'facebook_url', 'default_value' ); ?>" target="_blank">
                        <img src="<?php echo get_template_directory_uri(); ?>/img/facebook.png" alt="Follow us on Facebook"/>
                    </a>
                <?php endif; ?>
                <?php if ( get_theme_mod( 'plus_url' ) ) : ?>
                    <a href="<?php echo get_theme_mod( 'plus_url', 'default_value' ); ?>" rel="author" target="_blank">
                        <img src="<?php echo get_template_directory_uri(); ?>/img/gplus.png" alt="Follow us on Google Plus"/>
                    </a>
                <?php endif; ?>
                <?php if ( get_theme_mod( 'rss_url' ) ) : ?>
                    <a href="<?php echo get_theme_mod( 'rss_url', 'default_value' ); ?>" target="_blank">
                        <img src="<?php echo get_template_directory_uri(); ?>/img/rss.png" alt="Follow us on rss"/>
                    </a>
                <?php endif; ?>
            </div>
        <?php endif; ?>
  • The topic ‘Support some but not all social links in theme mod’ is closed to new replies.