How to add social share icons without any plugin?

Date: January 13th, 2020
Category: Questions, 230 Views

Asked by: Bina, Location: Berlin, Germany

Hi Manish, I need to implement social media share icons on my blog posts, will you help?

I don’t want to use any plugin, as my last plugin was calling lot of spam bots.


Answer

I will always recommend, not to use any plugin if you are a developer, plugins for non-coders

							
paste this in header.php with other stylesheet links <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> ( only if you don't have social icons ) paste this in 'single.php' after the loop of content <div id="someid" class="someclass"> Share my post:&nbsp;<a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink() ?>" target="_blank"><i class="fa fa-facebook" aria-hidden="true"></i></a> <a href="http://twitter.com/share?url=<?php the_permalink() ?>" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i></a> <a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink() ?>" target="_blank"><i class="fa fa-linkedin" aria-hidden="true"></i></a> <a href="mailto:type email address here?subject=I wanted to share this post with you from <?php bloginfo('name'); ?>&body=<?php the_title('','',true); ?>&#32;&#32;<?php the_permalink(); ?>" target="_blank"><i class="fa fa-envelope" aria-hidden="true"></i></a> <a href="https://api.whatsapp.com/send?text=<?php the_permalink() ?>" target="_blank"><i class="fa fa-whatsapp" aria-hidden="true"></i></a> </div> paste this in 'style.css/ stylesheet' anywhere #someid .fa { display: inline-block; font: normal normal normal 14px/1 FontAwesome; font-size: inherit; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; border: 1px solid black; border-radius: 1.23rem; padding: 0.36em; color: #000; width:30px; text-align:center; }
Share my post: 

2 responses to “How to add social share icons without any plugin?”

Leave a Reply

Your email address will not be published. Required fields are marked *