Skip to content

Instantly share code, notes, and snippets.

@coulterpeterson
Last active August 20, 2020 18:00
Show Gist options
  • Save coulterpeterson/f2643f767c65c5e51e8c7d67ffecf3db to your computer and use it in GitHub Desktop.
Save coulterpeterson/f2643f767c65c5e51e8c7d67ffecf3db to your computer and use it in GitHub Desktop.
Enqueue Scripts and Files in #WordPress #PHP
function add_theme_scripts() {
clearstatcache();
wp_enqueue_style( 'style', get_stylesheet_uri() );
wp_enqueue_style( 'slider', get_template_directory_uri() . '/css/slider.css', array(), filemtime( get_template_directory() . '/css/slider.css'), 'all');
wp_enqueue_script( 'script', get_template_directory_uri() . '/js/script.js', array ( 'jquery' ), filemtime( get_template_directory() . '/js/script.js'), true);
}
add_action( 'wp_enqueue_scripts', 'add_theme_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment