wp enqueue

Solutions on MaxInterview for wp enqueue by the best coders in the world

showing results for - "wp enqueue"
Matthias
01 Mar 2017
1/** 
2 *   Enqueue your theme styles and scripts in functions.php
3 *   use time() instead of a proper versioning to avoid caching when developing
4 */
5function my_theme_enqueue_scripts() {
6    wp_enqueue_style( 'default-style', get_stylesheet_uri(), [], '1.0.0', 'all' ); //default styles.css
7    wp_enqueue_style( 'main-style', get_stylesheet_directory_uri() . '/assets/css/main.min.css', [], time(), 'all' );
8    wp_enqueue_script( 'main-script', get_stylesheet_directory_uri() . '/assets/js/main.min.js', [], time(), false );
9}
10add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_scripts' );
11