Created
April 30, 2013 15:03
-
-
Save woogist/5489304 to your computer and use it in GitHub Desktop.
Function for adding Canvas v5.2 social icons to the Primary Navigation Menu
This file contains 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
add_filter( 'woo_nav_inside', 'woo_custom_social_links', 5 ); | |
function woo_custom_social_links () { | |
global $woo_options; | |
$settings = array( | |
'feed_url' => '', | |
'connect_rss' => '', | |
'connect_twitter' => '', | |
'connect_facebook' => '', | |
'connect_youtube' => '', | |
'connect_flickr' => '', | |
'connect_linkedin' => '', | |
'connect_delicious' => '', | |
'connect_rss' => '', | |
'connect_googleplus' => '', | |
'connect_dribbble' => '', | |
'connect_instagram' => '', | |
'connect_vimeo' => '', | |
'connect_pinterest' => '' | |
); | |
$settings = woo_get_dynamic_values( $settings ); | |
?> | |
<div class="social"> | |
<?php if ( $settings['connect_rss' ] == "true" ) { ?> | |
<a href="<?php if ( $settings['feed_url'] ) { echo esc_url( $settings['feed_url'] ); } else { echo get_bloginfo_rss('rss2_url'); } ?>" class="subscribe" title="RSS"></a> | |
<?php } if ( $settings['connect_twitter' ] != "" ) { ?> | |
<a target="_blank" href="<?php echo esc_url( $settings['connect_twitter'] ); ?>" class="twitter" title="Twitter"></a> | |
<?php } if ( $settings['connect_facebook' ] != "" ) { ?> | |
<a target="_blank" href="<?php echo esc_url( $settings['connect_facebook'] ); ?>" class="facebook" title="Facebook"></a> | |
<?php } if ( $settings['connect_youtube' ] != "" ) { ?> | |
<a target="_blank" href="<?php echo esc_url( $settings['connect_youtube'] ); ?>" class="youtube" title="YouTube"></a> | |
<?php } if ( $settings['connect_flickr' ] != "" ) { ?> | |
<a target="_blank" href="<?php echo esc_url( $settings['connect_flickr'] ); ?>" class="flickr" title="Flickr"></a> | |
<?php } if ( $settings['connect_linkedin' ] != "" ) { ?> | |
<a target="_blank" href="<?php echo esc_url( $settings['connect_linkedin'] ); ?>" class="linkedin" title="LinkedIn"></a> | |
<?php } if ( $settings['connect_delicious' ] != "" ) { ?> | |
<a target="_blank" href="<?php echo esc_url( $settings['connect_delicious'] ); ?>" class="delicious" title="Delicious"></a> | |
<?php } if ( $settings['connect_googleplus' ] != "" ) { ?> | |
<a target="_blank" href="<?php echo esc_url( $settings['connect_googleplus'] ); ?>" class="googleplus" title="Google+"></a> | |
<?php } if ( $settings['connect_dribbble' ] != "" ) { ?> | |
<a target="_blank" href="<?php echo esc_url( $settings['connect_dribbble'] ); ?>" class="dribbble" title="Dribbble"></a> | |
<?php } if ( $settings['connect_instagram' ] != "" ) { ?> | |
<a target="_blank" href="<?php echo esc_url( $settings['connect_instagram'] ); ?>" class="instagram" title="Instagram"></a> | |
<?php } if ( $settings['connect_vimeo' ] != "" ) { ?> | |
<a target="_blank" href="<?php echo esc_url( $settings['connect_vimeo'] ); ?>" class="vimeo" title="Vimeo"></a> | |
<?php } if ( $settings['connect_pinterest' ] != "" ) { ?> | |
<a target="_blank" href="<?php echo esc_url( $settings['connect_pinterest'] ); ?>" class="pinterest" title="Pinterest"></a> | |
<?php } ?> | |
</div> | |
<?php } // END woo_custom_social_links () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment