If you want to add script in footer then you have to use wp_footer() function. For example

Add the following code to your plugin

<?php

function add_this_script_footer(){ ?>

[YOUR JS CODE HERE]

<?php } 

add_action('wp_footer', 'add_this_script_footer');

?>

That’s it.

Have any doubt, then comment here!

Leave a Reply

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