Automatically add the Google +1 button
wordpress snippet
Adding this snippet to the functions.php of your wordpress theme will automatically add the Google +1 button to your wordpress posts. This is a great little snippet from ottopress.com
snippet : PHPcopy
add_filter('the_content', 'google_plusone');
function 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','google_plusone_script');
function google_plusone_script() {
wp_enqueue_script('google-plusone', 'https://apis.google.com/js/plusone.js', array(), null);
}
this months featured snippets
- http://wellbeing-support.com Ana Peterson
- http://wpsnipp.com Kevin Chard
- http://wellbeing-support.com Ana Peterson
- http://wpsnipp.com Kevin Chard
- http://gadgetsnewsline.com/ Gadgets NewsLine
- http://wpsnipp.com Kevin Chard






