Plugin Author
Creame
(@creapuntome)
You can use the filter whatsappme_get_settings. Add this code in your theme functions.php to hide WhatsApp me button on all blog posts:
add_filter( 'whatsappme_get_settings', function( $settings ) {
if ( is_singular( 'post' ) ){
$settings['show'] = false;
}
return $settings;
});
Thanks. It works.
How can I do the same for the Blog Home Page?
http://www.animalclinic.com.br/site/blog/
Plugin Author
Creame
(@creapuntome)
Hello!
You can disable WhatsApp me button in all blog pages (archive, single, categories, tags, etc.) changing the previous code with this:
add_filter( 'whatsappme_get_settings', function( $settings, $post ) {
if ( get_post_type( $post ) == 'post' ) {
$settings['show'] = false;
}
return $settings;
}, 10, 2);
Do we need to put this code on all the pages in order to disable WhatsApp icon incase I want the WhatsApp icon only on single page of my website, please guide me on that
Plugin Author
Creame
(@creapuntome)
Hi @salmannasee1
If you want to disable WhatsApp me button in all pages except one you can add this code in your theme functions.php:
add_filter( 'whatsappme_get_settings', function( $settings, $post ) {
$settings['show'] = is_object( $post ) && $post->ID == YOUR_POST_ID;
return $settings;
}, 10, 2);
Replace YOUR_POST_ID with de ID number of the page that you want to show the button. To find the ID it’s very simple.
-
This reply was modified 7 years, 10 months ago by
Creame.