Facebook分享无法在Safari或Chrome中运行

时间:2014-01-08 17:16:55

标签: facebook share

我正在使用wordpress,我的脸书分享按钮代码与IE和Firefox一起使用,而不是Chrome或Firefox。

以下是我从Facebook网站上获取的代码:https://developers.facebook.com/docs/plugins/share-button/

在header.php中,我有:<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml">
<head>

在single.php上我有:<fb:share-button type="box_count" href="http://<?php echo($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);?>"></fb:share-button>

我做错了什么?

示例:http://worldinsport.com/calcio-fiorentino-a-bruising-anarchic-and-exhilarating-spectacle-of-sport/

由于

1 个答案:

答案 0 :(得分:0)

试试这个:

<div class="fb-share-button" data-href="http://<?php echo($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);?>" data-type="button_count"></div>

OR

<a href="#" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(location.href)+'&t=whole description whatever you want to write here','','width=626,height=436'); return false;">
                        <img alt="Share on Facebook" src="/imagesico-facebook-2.png"></a>