Chlebta
Chlebta

Reputation: 3110

Share Google+ button issue

I'm trying to add share button to my website and I have chosed to use 'sharrre.com' script all work's fine For twitter and Facebook but for google+ button it's not shown
This is my code :

$('#twitter').sharrre({
  share: {
    twitter: true
  },
  enableHover: false,
  enableTracking: true,
  buttons: { twitter: {via: '_JulienH'}},
  click: function(api, options){
    api.simulateClick();
    api.openPopup('twitter');
  }
});

$('#facebook').sharrre({
  share: {
    facebook: true
  },
  enableHover: false,
  enableTracking: true,
  click: function(api, options){
    api.simulateClick();
    api.openPopup('facebook');
  }
});
$('#googleplus').sharrre({
  share: {
    googlePlus: true
  },
  enableHover: false,
  enableTracking: true,
  click: function(api, options){
    api.simulateClick();
    api.openPopup('googlePlus');
  }
});

Full code see my JSfiddle
And I followed this demo

So can any one tell me why Google+ button don't appear?

Upvotes: 2

Views: 2366

Answers (4)

Dexter Adams
Dexter Adams

Reputation: 524

The easily missed but very important key to remember is having the sharrre.php file placed in the same location as the sharrre.js file as Stuart touched on above. Hope I don't get dinged for dupe...this is helped me.

I tried everything to no avail until I placed the sharrre.php in the same folder with .js file.

Upvotes: 0

Foxinni
Foxinni

Reputation: 4000

You need to add a correct cURL url parameter.

$('#google').sharrre({
  share: {
        googlePlus: true
  },
  urlCurl: '/ts-includes/sharrre.php',
  template: '<a class="box" href="#"><div class="count" href="#">{total}</div><div class="share"><span></span>+1</div></a>',

  enableHover: false,
  enableTracking: true,
  click: function(api, options){
        api.simulateClick();
        api.openPopup('googlePlus');
  }
});

For WordPress I'm using: urlCurl: '<?php echo get_template_directory_uri() ?>/theme-includes/sharrre.php'

Remember to have the sharrre.php in the right location on your server/localhost.

Issue here -> https://github.com/Julienh/Sharrre/issues/44

Upvotes: 2

Chlebta
Chlebta

Reputation: 3110

I figured The problem For my googleplus script i forgot to add urlCurl option.
This is Google+ Old function :

 $('#googleplus').sharrre({
  share: {
    googlePlus: true
  },
  enableHover: false,
  enableTracking: true,
  click: function(api, options){
    api.simulateClick();
    api.openPopup('googlePlus');
  }
});

And this is the new one :

    $('#googleplus').sharrre({
  share: {
    googlePlus: true
  },
  enableHover: false,
  enableTracking: true,
  urlCurl: '',
  click: function(api, options){
    api.simulateClick();
    api.openPopup('googlePlus');
  }
});

Upvotes: 0

rg88
rg88

Reputation: 20977

You are missing a file. The code is looking for sharrre.php (which is included in the download for sharrre)

In the test I ran it looked for it in the same directory where you have the file that uses it (or you could just include it). Giving access to that file will fix your problem.

Upvotes: 0

Related Questions