Skip to content

Instantly share code, notes, and snippets.

@SeanChDavis
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save SeanChDavis/7bb3390fbee233f8612a to your computer and use it in GitHub Desktop.

Select an option

Save SeanChDavis/7bb3390fbee233f8612a to your computer and use it in GitHub Desktop.
EDD Lattice Custom Social Icons Function
/**
* custom function for footer icons
*/
function custom_lattice_icons() {
$twitter = get_theme_mod( 'lattice_twitter' );
$facebook = get_theme_mod( 'lattice_facebook' );
$instagram = get_theme_mod( 'lattice_instagram' );
$gplus = get_theme_mod( 'lattice_gplus' );
if ( $twitter || $facebook || $instagram || $gplus ) {
echo '<div class="social-profiles">';
}
if ( ! empty( $twitter ) ) {
printf( '<a class="twitter" href="https://twitter.com/%1$s"><i class="fa fa-twitter"></i></a>', strip_tags( html_entity_decode( $twitter ) ) );
}
if ( ! empty( $facebook ) ) {
printf( '<a class="facebook" href="%1$s"><i class="fa fa-facebook"></i></a>', esc_url( $facebook ) );
}
if ( ! empty( $instagram ) ) {
printf( '<a class="instagram" href="http://instagram.com/%1$s"><i class="fa fa-instagram"></i></a>', strip_tags( html_entity_decode( $instagram ) ) );
}
if ( ! empty( $gplus ) ) {
printf( '<a class="google-plus" href="%1$s"><i class="fa fa-google-plus"></i></a>', esc_url( $gplus ) );
}
?><a class="custom-mail" href="THE_URL"><i class="fa fa-envelope-o"></i></a>
<?php
if ( $twitter || $facebook || $instagram || $gplus ) {
echo '</div><!-- /.social-profiles -->';
}
}
@SeanChDavis
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment