Option tree social links render

<?php if ( function_exists( 'ot_get_option' ) ) { $social_media_channels = array( "Facebook" => "fa fa-facebook", "LinkedIn" => "fa fa-linkedin", "Instagram" => "fa fa-instagram" ); $social_media_icons = ot_get_option( 'social_links' ); }; ?> <?php if ( $social_media_icons ) { ?> <ul class="social-media-icons-sections"> <?php foreach ( $social_media_icons as $key=>$icon ) { if ( $social_media_channels[$icon['name']] ) { echo "<li class='social-media-icon'><a target='_blank' href='" . $icon['href'] . "'><i class='" . $social_media_channels[$icon['name']] . "'></i></a></li>"; } } ?> </ul> <?php } ?>
This short snippet used for rendering data from WordPress plugin "Option Tree".
It defines classes which has been used together with FontAwesome font.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.