首先,我知道FB的"分享"按钮已经被弃用了,但事情是我碰巧发现了这个网站22words.com,真的很喜欢在所有帖子末尾出现的FB和Twitter的大分享按钮。
有谁知道怎么做呢?
任何帮助将非常感激!
直接使用:
<a href='https://www.facebook.com/sharer/sharer.php?u=THELINKTOSHARE'>Share on Facebook</a>
并添加自己的样式,使其看起来像你想要的。
Twitter使用:
<a href="https://twitter.com/home?status=THELINKTOSHARE">Share on Twitter</a>
使用Facebook用户名和密码登录FacebookDeveloper Site
然后点击DOC菜单->分享->社交插件
在那个页面你可以看到11个Facebook插件(喜欢,分享等)代码的JS,JQ,HTMl等可用。
只是复制代码和过去到你的源代码…简单:)
for facebook
<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fparse.com" target="_blank">
<img src="YOURIMAGEURL" />
</a>
查看更多详细信息请点击这里
要实际插入到WP中,请将以下内容粘贴到functions.php文件中:见法典
add_filter( 'the_content', 'my_the_content_filter', 20 );
function my_the_content_filter( $content ) {
$content .= '<div class="social"><a href="https://www.facebook.com/sharer/sharer.php?u='.get_permalink().'">Share on Facebook</a>';
$content .= '<a href="https://twitter.com/home?status='.get_permalink().'">Share on Twitter</a>
</div>';
return $content; // Returns the content.
}
添加您的图像和CSS。