How to enable social share on blog posts without any plugin?

Date: April 4th, 2020
Category: Questions, 182 Views

Asked by: Caroline, Location: London, UK

Hi Manish,

I saw your posts that you can achieve anything without plugins, will you help me out?

I am 2 years experienced web developer based in London, UK. I am creating one blog website from scratch using Bootstrap 4, I need social icons to be displayed at bottom side of blog post, I used a plugin but that reduces the load time of my website to 12%, any suggestion.

For displaying icons I am using fontawesome CDN.


Answer

Hi, Caroline

edit single.php and paste the following codes.

							
<div id="share" class="py-3"> <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="https://api.whatsapp.com/send?text=<?php the_permalink() ?>" target="_blank"><i class="fa fa-whatsapp" aria-hidden="true"></i></a> </div>
Share my post: 

Leave a Reply

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