Last active
August 20, 2020 18:00
-
-
Save coulterpeterson/f2643f767c65c5e51e8c7d67ffecf3db to your computer and use it in GitHub Desktop.
Enqueue Scripts and Files in #WordPress #PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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