Created
May 1, 2013 10:36
-
-
Save woogist/5494640 to your computer and use it in GitHub Desktop.
Add logic to add social icons to hustle header
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
| add_filter( 'woo_header_inside', 'woo_custom_social_links', 10 ); | |
| function woo_custom_social_links() { | |
| global $woo_options; | |
| //Setup default variables, overriding them if the "Theme Options" have been saved. | |
| $settings = array( | |
| 'feed_url' => '', | |
| 'connect_rss' => '', | |
| 'connect_twitter' => '', | |
| 'connect_facebook' => '', | |
| 'connect_youtube' => '', | |
| 'connect_flickr' => '', | |
| 'connect_linkedin' => '', | |
| 'connect_delicious' => '', | |
| 'connect_rss' => '', | |
| 'connect_googleplus' => '' | |
| ); | |
| $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 href="<?php echo esc_url( $settings['connect_twitter'] ); ?>" class="twitter" title="Twitter"></a> | |
| <?php } if ( $settings['connect_facebook' ] != "" ) { ?> | |
| <a href="<?php echo esc_url( $settings['connect_facebook'] ); ?>" class="facebook" title="Facebook"></a> | |
| <?php } if ( $settings['connect_youtube' ] != "" ) { ?> | |
| <a href="<?php echo esc_url( $settings['connect_youtube'] ); ?>" class="youtube" title="YouTube"></a> | |
| <?php } if ( $settings['connect_flickr' ] != "" ) { ?> | |
| <a href="<?php echo esc_url( $settings['connect_flickr'] ); ?>" class="flickr" title="Flickr"></a> | |
| <?php } if ( $settings['connect_linkedin' ] != "" ) { ?> | |
| <a href="<?php echo esc_url( $settings['connect_linkedin'] ); ?>" class="linkedin" title="LinkedIn"></a> | |
| <?php } if ( $settings['connect_delicious' ] != "" ) { ?> | |
| <a href="<?php echo esc_url( $settings['connect_delicious'] ); ?>" class="delicious" title="Delicious"></a> | |
| <?php } if ( $settings['connect_googleplus' ] != "" ) { ?> | |
| <a href="<?php echo esc_url( $settings['connect_googleplus'] ); ?>" class="googleplus" title="Google+"></a> | |
| <?php } ?> | |
| </div> | |
| <?php | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment