Warning: Declaration of relatedpostsCPWidget::update($new_instance) should be compatible with WP_Widget::update($new_instance, $old_instance) in /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php on line 53

Warning: Cannot modify header information - headers already sent by (output started at /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php:53) in /home/nrtechweb/public_html/wp-content/plugins/cleantalk-spam-protect/cleantalk.php on line 649

Warning: Cannot modify header information - headers already sent by (output started at /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php:53) in /home/nrtechweb/public_html/wp-content/plugins/cleantalk-spam-protect/cleantalk.php on line 666

Warning: Cannot modify header information - headers already sent by (output started at /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php:53) in /home/nrtechweb/public_html/wp-content/plugins/cleantalk-spam-protect/cleantalk.php on line 673

Warning: Cannot modify header information - headers already sent by (output started at /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php:53) in /home/nrtechweb/public_html/wp-content/plugins/cleantalk-spam-protect/cleantalk.php on line 679
Custom social share for wordpress posts - NR Tech Web Solution | NR Tech Web Solution

Blog

Custom social share for wordpress posts

Today, i am going to introduce a basic but very important article on Social Share for social networks. This functionality can increase your website traffic and can make your site popular over the internet, i am talking about Google Plus, Facebook, Twitter etc.These sites are very useful to collect page impression and traffic.

So being a WordPress developer,I created many more websites on WordPress and use many more ready made plugins for social share.

Sometime they are useful and sometime they are not useful or i can say in other word they does not fulfill our project requirement.

Generally ready made plugins work on WordPress single post page or post detail page or in technically single.php page .

They generally  do not work on multiple posts rendering page  where many posts are showing one by one at that time if we use ready made plugin then they share the right post but they do not take right post featured image or post thumbnail .

So to get rid of this problem i  find out a very simple and good solution.

Now you just need to follow some simple steps for your blog.There are WordPress theme file that need to be updated.

  • Functions.php
  • Style.css
  • Header.php

Now open functions.php of your current running theme and past this code.

Now open your theme style.css file and copy and paste this css code this code will help to style the sharing buttons.

Now last step to finish our small but effective functionality.
Just open header.php and add some meta tags manually.I will explain why we are adding manually these meta tags but for this time i use manually way.
Please note these tags should be placed in head tag.

This was the last step.Our code is ready but how to add use this code in loop page where many posts are showing one by one.

Usage :I am assuming that your applying on WordPress standard posts loop.Please use very first function in WordPress standard loop.
The function will generate the sharing buttons.you can add , as i am using this function in standard loop.

Good now we finished our task, its time see the changes.
If you have any doubt or query feel free to ask here i am always with you.

Thanks

Leave a Reply

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

Security *