Last active
August 29, 2015 14:06
-
-
Save SeanChDavis/7bb3390fbee233f8612a to your computer and use it in GitHub Desktop.
EDD Lattice Custom Social Icons Function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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 -->'; | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example usage: https://easydigitaldownloads.com/support/topic/adding-a-third-footer-icon/#post-310598