// Social media sharing buttons
function crunchify_social_sharing_buttons($content) {
    global $post;
    if(is_singular() || is_home()){
        // Get current page URL 
        $crunchifyURL = urlencode(get_permalink());
        // Get current page title
        $crunchifyTitle = str_replace( ' ', '%20', get_the_title());
        // Get Post Thumbnail for pinterest
        $crunchifyThumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
        // Construct sharing URL without using any script
        $twitterURL = ''.$crunchifyTitle.'&url='.$crunchifyURL.'&via=Crunchify';
        $facebookURL = ''.$crunchifyURL;
        $googleURL = ''.$crunchifyURL;
        $whatsappURL = 'whatsapp://send?text='.$crunchifyTitle . ' ' . $crunchifyURL;
        $linkedInURL = ''.$crunchifyURL.'&title='.$crunchifyTitle;
        // Based on popular demand added Pinterest too
        $pinterestURL = ''.$crunchifyURL.'&media='.$crunchifyThumbnail[0].'&description='.$crunchifyTitle;
        // Add sharing button at the end of page/page content
        $content .= '<!-- social sharing. Get your copy here: -->';
        $content .= '<div class="crunchify-social">';
        $content .= '<a class="crunchify-link crunchify-facebook icon-Facebook-2" href="'.$facebookURL.'" target="_blank" title="Share on Facebook"></a>';
        $content .= '<a class="crunchify-link crunchify-linkedin icon-Linkedin" href="'.$linkedInURL.'" target="_blank" title="Share on LinkedIn"></a>';        
        $content .= '<a class="crunchify-link crunchify-twitter icon-Twitter" href="'. $twitterURL .'" target="_blank" title="Share on Twitter"></a>';
        $content .= '<a class="crunchify-link crunchify-googleplus icon-Google-Plus" href="'.$googleURL.'" target="_blank" title="Share on Google+"></a>';
        $content .= '<a class="crunchify-link crunchify-whatsapp icon-whatsapp" href="'.$whatsappURL.'" target="_blank" title="Share with Whatsapp"></a>';
        $content .= '<a class="crunchify-link crunchify-pinterest icon-Pinterest" href="'.$pinterestURL.'" data-pin-custom="true" target="_blank" title="Pin it!"></a>';
        $content .= '</div>';
        return $content;
        // if not a post/page then don't include sharing button
        return $content;
add_filter( 'the_content', 'crunchify_social_sharing_buttons');
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter