Google+ Social icon doesn’t increment from ‘0’ despite shared many times in DW Focus
Google+ Social icon doesn’t increment from ‘0’ despite shared many times in DW Focus theme. Can you please fix this up asap.
Updated!
Hi Mike,
To fix the issue, please add the following code lines to the file /functions.php, above β?>β
function dw_get_plusones_share_count($url) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://clients6.google.com/rpc");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POSTFIELDS, '[{"method":"pos.plusones.get","id":"p","params":{"nolog":true,"id":"'.rawurldecode class="prettyprint"($url).'","source":"widget","userId":"@viewer","groupId":"@self"},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
$curl_results = curl_exec ($curl);
curl_close ($curl);
$json = json_decode class="prettyprint"($curl_results, true);
return isset($json[0]['result']['metadata']['globalCounts']['count'])?intval( $json[0]['result']['metadata']['globalCounts']['count'] ):0;
}
– Then, at the line 434 in the file /functions.php
replace
<li class="google"><i class="icon-google-plus-sign"></i><a href="https://plus.google.com/share?url=<?php echo $url; ?>" ><?php _e('Google +','dw_focus') ?></a><span>0</span></li>
with
<li class="google"><i class="icon-google-plus-sign"></i><a href="https://plus.google.com/share?url=<?php echo $url; ?>" ><?php _e('Google +','dw_focus') ?></a><span><?php echo dw_get_plusones_share_count( $url ); ?></span></li>
Hope this helps,
Regards,
Rambu
Can you please include all the fixes in the DW Focus theme and then ship it with a new release. This will make the implementation clean.
We don’t want to touch the core files of your theme.
i sent an email to [email protected]. please check it.
I want it also please.
I have the same problem and needs to fix please help Thanks.
Firstly, you can check your version. we have released the latest version 1.1.0. if you updated the theme and still face there issue, you can send me username & password of your site (via private answer) for further checking.
Hi Rambu,
The code is incorrect. It is displaying same static value (15) for all posts!
Please look into it.
I have updated code again and email new file to your email
Working now,,you can close this thread now..
Hi Rambu, can i get the updated code also please? Mine G+ not working aswell. π
Please login or Register to submit your answer