Created
November 28, 2012 11:28
-
-
Save LucaRosaldi/4160608 to your computer and use it in GitHub Desktop.
WP: Google +1 Button
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('the_content', 'wpr_google_plusone'); | |
function wpr_google_plusone($content) { | |
$content = $content.'<div class="plusone"><g:plusone size="tall" href="'.get_permalink().'"></g:plusone></div>'; | |
return $content; | |
} | |
add_action ('wp_enqueue_scripts','wpr_google_plusone_script'); | |
function wpr_google_plusone_script() { | |
wp_enqueue_script('google-plusone', 'https://apis.google.com/js/plusone.js', array(), null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment