How to add Facebook Chat to all pages
To display Facebook Chat plugin on all pages, you need to add its shortcode to your website's theme. After you configured the widget, add the following line to the footer.php file of your theme (right before the </body>
):
<?php echo do_shortcode('[elfsight_facebook_chat id="1"]'); ?>
Learn more about the do_shortcode function at https://developer.wordpress.org/reference/functions/do_shortcode/
For Child Themes
If you use a child theme, you can add the shortcode to the functions.php file of your child theme:
function elfsight_add_facebook_chat_shortcode_to_footer() { echo do_shortcode('[elfsight_facebook_chat id="1"]'); } add_action('wp_footer', 'elfsight_add_facebook_chat_shortcode_to_footer');