Created
March 20, 2012 00:03
-
-
Save rossharper/2128718 to your computer and use it in GitHub Desktop.
Registering sharing scripts with Wordpress (inc Pinterest)
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
<?php | |
function register_sharing_scripts() | |
{ | |
if( is_single() || is_home() ) | |
{ | |
wp_enqueue_script('twitter-share', 'http://platform.twitter.com/widgets.js', null, null, true); | |
wp_enqueue_script('facebook-share', 'http://static.ak.fbcdn.net/connect.php/js/FB.Share', null, null, true); | |
wp_enqueue_script('google-plusone', 'https://apis.google.com/js/plusone.js', array(), null, true); | |
wp_enqueue_script('pinterest', 'http://assets.pinterest.com/js/pinit.js', array(), null, true); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'register_sharing_scripts' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment