简体   繁体   中英

How can I custom-make big Facebook and Twitter share button like this?

First of all, I'm aware that the FB “share” button has been deprecated but the thing is that I happened to find this site 22words.com and really like the big FB and Twitter share buttons appearing at the end of all posts.

Does anyone know how to do it exactly like that?

Any help would be much appreciated!

Just use:

<a href='https://www.facebook.com/sharer/sharer.php?u=THELINKTOSHARE'>Share on Facebook</a>

and add your own styles to make it look however you want.

For Twitter use:

<a href="https://twitter.com/home?status=THELINKTOSHARE">Share on Twitter</a>

Using Your Facebook user name and password log in FacebookDeveloper Site

Then click DOC Menu --> Sharing --> Social Plugins

In that page you can see 11 Facebook plugin(Like,Share,etc) codes for JS,JQ,HTMl,etc are available..

Just copy the code and past in into your source code... Simple :)

for facebook

<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fparse.com" target="_blank"> <img src="YOURIMAGEURL" /> </a>

for more brief details Click here

To actually insert this into WP paste this in your functions.php file: See the codex

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.
}

Add your images and CSS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM