Skip to content

Instantly share code, notes, and snippets.

@farookibrahim
Created January 29, 2016 07:36
Show Gist options
  • Select an option

  • Save farookibrahim/83b94b57e327c9c0479f to your computer and use it in GitHub Desktop.

Select an option

Save farookibrahim/83b94b57e327c9c0479f to your computer and use it in GitHub Desktop.
Social Media Links Open in New Tab
if ( ! function_exists( 'bethlehem_social_icons' ) ) {
/**
* Display social icons
* If the subscribe and connect plugin is active, display the icons.
* @link http://wordpress.org/plugins/subscribe-and-connect/
* @since 1.0.0
*/
function bethlehem_social_icons() {
$social_icons_args = apply_filters( 'bethlehem_social_icons_args', array(
array(
'id' => 'facebook',
'title' => __( 'Facebook', 'bethlehem' ),
'class' => 'hb-fb',
'icon' => 'fa fa-facebook',
'link' => '#'
),
array(
'id' => 'twitter',
'title' => __( 'Twitter', 'bethlehem' ),
'class' => 'hb-tw',
'icon' => 'fa fa-twitter',
'link' => '#'
),
array(
'id' => 'google-plus',
'title' => __( 'Google Plus', 'bethlehem' ),
'class' => 'hb-google-plus',
'icon' => 'fa fa-google-plus',
'link' => '#'
),
) );
?>
<ul class="hb-social">
<?php foreach( $social_icons_args as $social_icon ) : ?>
<?php if( !empty( $social_icon['link'] ) ) : ?>
<li class="<?php echo esc_attr( $social_icon['class'] ); ?>"><a title="<?php echo esc_attr( $social_icon['title'] );?>" href="<?php echo esc_url( $social_icon['link'] ); ?>" target="_blank"><i class="<?php echo esc_attr( $social_icon['icon'] ); ?>"></i></a></li>
<?php endif; ?>
<?php endforeach; ?>
</ul><!-- /.list-social-icons -->
<?php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment