WordPress and JavaScript
From Wiki @ Karl Jones dot com
WordPress can include JavaScript. This is done with WordPress themes.
wp_enqueue_script()
WordPress has a function named wp_enqueue_script()
which allows you to "enqueue" a script.
That is, the script is placed in a queue of activities which WordPress will perform as it generates the website.
You can use wp_enqueue_script()
in two places:
- In
functions.php
- In a WordPress plugin
functions.php
The optional functions.php
contains custom PHP for a WordPress theme.