Hi
Now I understand. K2 has it's own code for social buttons. Code can be found in /html/com_k2/templates/default/item.php
- Code: Select all
<?php if($params->get('itemTwitterButton',1) || $params->get('itemFacebookButton',1) || $params->get('itemGooglePlusOneButton',1)): ?>
<div class="itemSocialSharing">
<?php if($params->get('itemTwitterButton',1)): ?>
<div class="itemTwitterButton"> <a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal"<?php if($params->get('twitterUsername')): ?> data-via="<?php echo $params->get('twitterUsername'); ?>"<?php endif; ?>><?php echo JText::_('K2_TWEET'); ?></a>
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
</div>
<?php endif; ?>
<?php if($params->get('itemFacebookButton',1)): ?>
<div class="itemFacebookButton">
<script type="text/javascript">
window.addEvent('load', function(){
(function(){
if(document.id('fb-auth') == null) {
var root = document.createElement('div');
root.id = 'fb-root';
$$('.itemFacebookButton')[0].appendChild(root);
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = document.location.protocol + "//connect.facebook.net/<?php echo $fblang; ?>/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
}
}());
});
</script>
<div class="fb-like" data-width="150" data-layout="standard" data-action="like" data-show-faces="false" data-share="true"></div>
</div>
<?php endif; ?>
<?php if($params->get('itemGooglePlusOneButton',1)): ?>
<div class="itemGooglePlusOneButton">
<div class="g-plusone" data-size="standard"></div>
<script type="text/javascript">
window.___gcfg = {lang: 'en'}; // Define button default language here
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/platform.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
try maybe replace it with the template's code for social
- Code: Select all
<gavern:social><div id="gkSocialAPI"></gavern:social>
<gavern:social><div><g:plusone GK_GOOGLE_PLUS_SETTINGS callback="<?php echo $cur_url; ?>"></g:plusone></div></gavern:social>
<gavern:social><div><g:plus action="share" GK_GOOGLE_PLUS_SHARE_SETTINGS href="<?php echo $cur_url; ?>"></g:plus></div></gavern:social>
<gavern:social><div><fb:like href="<?php echo $cur_url; ?>" GK_FB_LIKE_SETTINGS></fb:like></div></gavern:social>
<gavern:social><div><a href="http://twitter.com/share" class="twitter-share-button" data-text="<?php echo $this->item->title; ?>" data-url="<?php $cur_url; ?>" gk_tweet_btn_settings>Tweet</a></div></gavern:social>
<gavern:social><div><a href="http://pinterest.com/pin/create/button/?url=<?php echo $cur_url; ?>&media=<?php echo $pin_image; ?>&description=<?php echo str_replace(" ", "%20", $this->item->title); ?>" class="pin-it-button" count-layout="GK_PINTEREST_SETTINGS"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="<?php echo JText::_('TPL_GK_LANG_PINIT_TITLE'); ?>" /></a></div></gavern:social>
<gavern:social></div></gavern:social>
I've never done that, but it's worth trying before making changes to K2 code for that part directly.