[英]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.