Add Custom Javascript in Functions.php File

That code puts custom javascript tag at footer.

<?php
function hook_javascript_footer() {
  ?>
  <script type="text/javascript">
    // Javascript
  </script>
  <?php
}
add_action('wp_footer', 'hook_javascript_footer');
?>

Start the Discussion!Leave a Reply