So, I have a custom Javascript code that inserts a pop-up widget in a webpage. The source code is irrelevant but it works by manually pasting before the <\body>
tag of the website, such that:
<body>
/*
do something
*/
<script type="text/javascript" id="widget-code">
/*
widget pops up
*/
</script>
<\body>
What I want to do is include that script in the plugin that I'm developing so that the widget will appear in all webpages of the Wordpress site. How do I do such?
/**
* Plugin Name: Test Plugin
* Plugin URI: http://example.com
* Description: test plugin
* Author: John Doe
**/
If I'm not mistaken, this is essentially a task of pasting the script before the <\body>
tag in all webpages but inside a plugin?