[英]How can I custom-make big Facebook and Twitter share button like this?
首先,我知道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>
在FacebookDeveloper网站上使用您的Facebook用户名和密码登录
然后单击DOC菜单->共享->社交插件
在该页面中,您可以看到JS,JQ,HTMl等的11个Facebook插件代码(如Like,Share等)。
只需将代码复制并粘贴到您的源代码中即可...简单:)
对于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。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.