Add facebook & twitter share link
Hello friends, welcome to our site. In this article, I am going to discuss how to add share button like facebook and twitter. If you want to encourage your visitor to share your site content on facebook and twitter then you need to do something for this.
Why do you need to add social share links on the website?
If you have a blog site or have a business website, then you always try to spread it’s data to the public. That’s why social sharing is a great way to communicate with the target audience and share your thoughts or opinions on business matters in an informal way.
Social media help you to increase the more visitors in your website. So the success of a website largely depends on how many people actually read it and one important way to increase readership is to include social share buttons on every page of your site. If you have a blog site so include social share buttons on every blog post. I hope, it is the biggest way to increase your blog or website visitor.
Most social networks have built-in sharing links you can use to send users directly to a pre-populated, one-click sharing page. In this article, I will go step by step, just follow me.
Now for facebook sharing, we will use open graph meta tags. Here is the code below. Just add this code inside the head tag of your site.
<meta property=”og:url” content=”Your page url” /> //Give your page url here.
<meta property=”og:type” content=”website” /> //If it’s a website left it as it is.
<meta property=”og:title” content=”Your page title” /> //Give your page title here.
<meta property=”og:description” content=”Your page description” /> //Give a short page description here.
<meta property=”og:image” content=”Your shareable image src” /> //Give your full image source.
//End Open Graph meta tags
Now we need to add a shareable link in your site by which user can share their content in facebook. And here is an example.
onclick=”javascript:window.open(this.href, ”, ‘menubar=no,toolbar=no,resizable=yes,
scrollbars=yes,height=600,width=600’);return false;”” target=”_blank” class=”fb”>Facebook Share</a>
Now our next step is to share content with twitter. Twitter have also some meta tags for sharing content. So just added them inside the head tags.
<meta name=”twitter:card” content=”summary” />
<meta name=”twitter:site” content=”@” />
<meta name=”twitter:title” content=”Your page title” />
<meta name=”twitter:description” content=”Your page description” />
<meta name=”twitter:image” content=”Your page image full path” />
Now we need to add a shareable link in your site by which user can share their content in twitter. And here is an example.
If everything is right then you can share your post on facebook and twitter. If you face any problem regarding this topic leaves a comment. I am here to solve your problem.