WordPress.org

Ready to get started?Download WordPress

Forums

Iconic One
[resolved] Support some but not all social links in theme mod (1 post)

  1. Dane Morgan
    Member
    Posted 7 months ago #

    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; ?>

Reply

You must log in to post.

About this Theme

About this Topic