The whole installation process is explanatory with enough material to complete the integration of the graphic element in WordPress.
We create a new plugin for WordPress users to add the WhatsApp Widget. This plugin makes the integration of the WhatsApp Widget super easy. Please if you need support, contact us.
This is a new WordPress Website using our WhatsApp Widget. This is an amazing Website from Singapore related to food and sustainability. They promote a way to consume where the goal is to reach zero waste.
![](https://i0.wp.com/tochat.be/click-to-chat/wp-content/uploads/2022/12/growerck-singapore-wordpress-whatsapp.jpg?resize=640%2C406&ssl=1)
These are the steps you need to install your WhatsApp Widget
- Copy the widget code
![](https://i0.wp.com/tochat.be/click-to-chat/wp-content/uploads/2022/04/Unknown-5.jpeg?resize=640%2C373&ssl=1)
2. Inside your WordPress go to APPEARANCE
3. Click on WIDGETS
![](https://i0.wp.com/tochat.be/click-to-chat/wp-content/uploads/2022/04/Unknown-4.jpeg?resize=137%2C259&ssl=1)
4. Find the Custom HTML
![](https://i0.wp.com/tochat.be/click-to-chat/wp-content/uploads/2022/04/Unknown-3-1.jpeg?resize=520%2C520&ssl=1)
5. Select the FOOTER
![](https://i0.wp.com/tochat.be/click-to-chat/wp-content/uploads/2022/04/Unknown-2-2.jpeg?resize=543%2C429&ssl=1)
6. Press on PERSONALIZE HTML
![](https://i0.wp.com/tochat.be/click-to-chat/wp-content/uploads/2022/04/Unknown-1-3.jpeg?resize=640%2C281&ssl=1)
7. Paste the widget code ( do not put any title)
8. Save
9. Your Widget is ready ❗️
Multilingual support for WordPress & WhatsApp Widget
For Polylang:
<?php if(pll_current_language() == ‘en’){ ?>
<!– CÓDIGO DEL WIDGET –>
<?php } elseif(pll_current_language() == ‘es’){ ?>
<!– WIDGET SCRIPT –>
<?php } ?>
For WPML
<?php if(ICL_LANGUAGE_CODE==’es’) { ?>
<!– CÓDIGO DEL WIDGET –>
<?php } elseif(ICL_LANGUAGE_CODE==’en’) { ?>
<!– WIDGET SCRIPT –>
<?php } ?>
Adding the WhatsApp Widget in WordPress with ShortCode
Using the file functions.php from the active theme, we can create a shortcode using add_shortcode.
<?php function sc_tochat() {
ob_start();
?>
<script defer src=”https://widget.tochat.be/bundle.js?key=ef8c9006-a28c-4bb4-a602-5caebffa34a0“></script>
<?php
$output = ob_get_contents();
ob_end_clean();
return $output;
}
add_shortcode( ‘tochat_widget’, ‘sc_tochat’ );
Once we have the shortcode we can add it anywhere in our website.
- Using the theme editor: [tochat_widget]
- In our template using do_shortcode:
<?php echo do_shortcode(‘[tochat_widget]’) ?>