Hit enter to search or ESC to close
Current date: April 4, 2020
Hit enter to search or ESC to close
Hit enter to search or ESC to close

This is a quick fix on WordPress plugin called ‘Share Posts on Whatsapp’ by Aftab Husain. I have been using this plugin for quite sometime and it did not give me much problem. But it’s lack the facility to limit the sharing button to only posts, or to only pages.

I took a look at the coding and actually it can be further customized, such as limiting the sharing button to only blog posts (not pages). In the plugin folder, notice that there is a file called ‘share-post-on-whatsapp.php’. Edit the file and find this line:

$html = $html . "<div class='clear '></div></div>";

Add this new line under it:

if(!is_single())$html="";

Save the file and you will notice Whatsapp button not displayed on pages anymore.

Comments
Leave a Reply

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

Highlights
Recent Posts
Instagram Feed
                                    #1pahangnet2020
                                    #1pahangnet2020
                                    #1pahangnet2020
                                    #1pahangnet2020
                                    #1pahangnet2020
                                    #1pahangnet2020
                                    #1pahangnet2020
                                    #1pahangnet2020
                                    #1pahangnet2020