Status
Not open for further replies.

lukey372

Active Member
300
2011
48
0
So I have been trying to add a google +1 button from a wordpress plugin and I am getting errors when adding in the php part of the script I have gotten:

<?php
if(function_exists('wp_socializer'){
echo wp_socializer('plusone-button', array(Settings));
}
?>

Could anyone point me in the right direction / edit the code for me ?

Regards

Luke
 
5 comments
You should put the settings in the array, don't just put the word settings there. If you want the default, you should be able to omit that parameter.

Try:


Code:
<?php
if(function_exists('wp_socializer')){
echo wp_socializer('plusone-button');
}
?>
 
Last edited:
Hey mate,

Thanks alot but i got this error.

Parse error: syntax error, unexpected '{' in /home/proxypro/public_html/Mauhab.com/wp-content/themes/mauhab/sidebar.php on line 4
 
Thanks alot, I got no errors etc but nothing is displaying :|

I'll just hire someone to do it for me thanks for your help though.

Regards

Luke
 
I would say don't use plugins for simple scripts which you can add without any difficulty.

You can customize the +1 button from here - http://www.google.com/webmasters/+1/button/

From the website after you customize you will get two parts of code like this below

Code:
<!-- Place this tag where you want the +1 button to render -->
<g:plusone annotation="inline"></g:plusone>

Place the following script code you get in the footer just above the </body> code :)

Code:
<!-- Place this render call where appropriate -->
<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

Source - http://www.google.com/webmasters/+1/button/
 
Status
Not open for further replies.
Back
Top