Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The proper way to include a script/stylesheet in Wordpress functions.php - wrote this to call from ST2 via fetch
<?php
function adam_load_scripts(){
wp_register_script( 'handle', get_template_directory_uri()."path", array('dep'), 'ver', 'footer?');
//to add a stylesheet, change all script to style except wp_enqueue_script
//wp_register_style( 'handle', get_template_directory_uri()."path", array('dep'), 'ver', 'media')
wp_enqueue_script('handle');
}
add_action('wp_enqueue_scripts', 'adam_load_scripts');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.