?>
Note: If you value your sanity, make sure there are no spaces after the closing php tag.
One of the most common uses for the functions.php file is enqueueing scripts and styles.
This is WordPress’ way of adding new scripts and stylesheets to avoid any sort of conflict between WordPress itself and themes and plugins.
For example, let’s say you want to add to your child theme. Cufon requires you to add 3 script tags to the
of your theme. So let’s go hack up a header.php file and manually add the scripts, right?NO! Hopefully you’ve been paying attention and you know we are going to be good little boys and girls and enqueue our scripts so there are no conflicts.
Head over to and download the necessary files if you want to follow along. This same process will apply to any scripts you want to use.
Note: Read over the full usage of the wp_enqueue_scripts function here:
In your functions.php file (in between the tags,) add the following:
12345678 | add_action('wp_enqueue_scripts', 'add_my_scripts'); // We are using the wp_enqueue_scripts function, and giving our function an arbitrary name of add_my_scripts |