WordPress and JavaScript

From Wiki @ Karl Jones dot com
Revision as of 07:31, 10 December 2015 by Karl Jones (Talk | contribs) (How it works)

Jump to: navigation, search

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:

functions.php

The optional functions.php contains custom PHP for a WordPress theme.


See also

External links