Manish Pushkar Jha

Full Stack Web Developer
March 1, 2021
2:55 pm

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

29 Views  •  April 14th, 2020  •  2 minutes read

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>