Output the Social Media Icons

 In
/* takes user input from the customizer and outputs linked social media icons */ function my_social_media_icons() { $social_sites = my_customizer_social_media_array(); /* any inputs that aren't empty are stored in $active_sites array */ foreach($social_sites as $social_site) { if( strlen( get_theme_mod( $social_site ) ) > 0 ) { $active_sites[] = $social_site; } } /* for each active social site, add it as a list item */ if ( ! empty( $active_sites ) ) { echo "<ul class='social-media-icons'>"; foreach ( $active_sites as $active_site ) { /* setup the class */ $class = 'fa fa-' . $active_site; if ( $active_site == 'email' ) { ?> <li> <a class="email" target="_blank" href="mailto:<?php echo antispambot( is_email( get_theme_mod( $active_site ) ) ); ?>"> <i class="fa fa-envelope" title="<?php _e('email icon', 'text-domain'); ?>"></i> </a> </li> <?php } else { ?> <li> <a class="<?php echo $active_site; ?>" target="_blank" href="<?php echo esc_url( get_theme_mod( $active_site) ); ?>"> <i class="<?php echo esc_attr( $class ); ?>" title="<?php printf( __('%s icon', 'text-domain'), $active_site ); ?>"></i> </a> </li> <?php } } echo "</ul>"; } }
Recent Posts
Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt