Twitter share count is not displaying.
Since the new update, the Twitter counter disappeared on my website as well. Will this be possible to fix with a new update? Many thanks.
simple-share-buttons-adder/inc/ssba_buttons.php
you will find this “ssba_linkedin” function
// get linkedin button
function ssba_linkedin($arrSettings, $urlCurrentPage, $strPageTitle, $booShowShareCount) {
/ Here Some code
}
$htmlShareButtons .= ”;
// ====================THis is new code for you ====================
if ($arrSettings[‘ssba_show_share_count’] == ‘Y’ && $booShowShareCount == true) {$htmlShareButtons .= ‘<span class=”ssba_sharecount”>’ . getLinkedinShareCount($urlCurrentPage) . ‘</span>’;}
//==================================end =================
return $htmlShareButtons;
}
Just i have solve it
sanees and mijncommunicatie
USE this on simple-share-buttons-adder/inc/ssba_buttons.php
// get twitter button
function ssba_twitter($arrSettings, $urlCurrentPage, $strPageTitle, $booShowShareCount) {
$twitterShareText = urlencode(html_entity_decode($strPageTitle . ‘ ‘ . $arrSettings[‘ssba_twitter_text’], ENT_COMPAT, ‘UTF-8’));
$htmlShareButtons = ‘‘;
if ($arrSettings[‘ssba_image_set’] != ‘custom’) {
$htmlShareButtons .= ‘<img src=”‘ . plugins_url() . ‘/simple-share-buttons-adder/buttons/’ . $arrSettings[‘ssba_image_set’] . ‘/twitter.png” title=”Twitter” class=”ssba ssba-img” alt=”Tweet about this on Twitter” />’;
}
else { $htmlShareButtons .= ‘<img src=”‘ . $arrSettings[‘ssba_custom_twitter’] . ‘” title=”Twitter” class=”ssba ssba-img” alt=”Tweet about this on Twitter” />’;
}
$htmlShareButtons .= ‘‘;
if ($arrSettings[‘ssba_show_share_count’] == ‘Y’ && $booShowShareCount == true) {
$htmlShareButtons .= ‘<span class=”ssba_sharecount”>’ . getTwitterShareCount($urlCurrentPage) . ‘</span>’;
}
return $htmlShareButtons;
}
function getTwitterShareCount($urlCurrentPage) {
$htmlTwitterShareDetails = wp_remote_get(‘http://urls.api.twitter.com/1/urls/count.json?url=’.$urlCurrentPage, array(‘timeout’ => 6));
if (is_wp_error($htmlTwitterShareDetails)) {
return 0;
}
$arrTwitterShareDetails = json_decode($htmlTwitterShareDetails[‘body’], true);
$intTwitterShareCount = $arrTwitterShareDetails[‘count’];
return ($intTwitterShareCount) ? ssba_format_number($intTwitterShareCount) : ‘0’;
}