Adding dynamic version info behind UnderStrap asset´s URL´s
This commit is contained in:
parent
c6e0d19cb3
commit
6c32331ade
|
@ -5,17 +5,18 @@
|
||||||
* @package understrap
|
* @package understrap
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ( ! function_exists( 'understrap_scripts' ) ) {
|
if ( ! function_exists( 'understrap_scripts' ) ) {
|
||||||
/**
|
/**
|
||||||
* Load theme's JavaScript sources.
|
* Load theme's JavaScript sources.
|
||||||
*/
|
*/
|
||||||
function understrap_scripts() {
|
function understrap_scripts() {
|
||||||
wp_enqueue_style( 'understrap-styles', get_stylesheet_directory_uri() . '/css/theme.min.css', array(),
|
// Get the theme data
|
||||||
'0.5.0' );
|
$the_theme = wp_get_theme();
|
||||||
|
wp_enqueue_style( 'understrap-styles', get_stylesheet_directory_uri() . '/css/theme.min.css', array(), $the_theme->get( 'Version' ) );
|
||||||
wp_enqueue_script( 'jquery' );
|
wp_enqueue_script( 'jquery' );
|
||||||
wp_enqueue_script( 'understrap-scripts', get_template_directory_uri() . '/js/theme.min.js', array(), '0.5.0',
|
wp_enqueue_script( 'understrap-scripts', get_template_directory_uri() . '/js/theme.min.js', array(), $the_theme->get( 'Version' ), true );
|
||||||
true );
|
|
||||||
|
|
||||||
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
||||||
wp_enqueue_script( 'comment-reply' );
|
wp_enqueue_script( 'comment-reply' );
|
||||||
}
|
}
|
||||||
|
@ -31,7 +32,7 @@ if ( ! function_exists( 'understrap_scripts' ) ) {
|
||||||
}
|
}
|
||||||
if ( is_page_template( ( 'page-templates/vertical-one-page.php' ) || is_home() || is_single() ) && $loadit ) {
|
if ( is_page_template( ( 'page-templates/vertical-one-page.php' ) || is_home() || is_single() ) && $loadit ) {
|
||||||
wp_enqueue_script( 'vertical-one-page', get_template_directory_uri() . '/js/vertical-one-page.js',
|
wp_enqueue_script( 'vertical-one-page', get_template_directory_uri() . '/js/vertical-one-page.js',
|
||||||
array( 'jquery' ), '0.5.0', true );
|
array( 'jquery' ), true );
|
||||||
$page_for_posts = strtolower( get_the_title( get_option( 'page_for_posts' ) ) );
|
$page_for_posts = strtolower( get_the_title( get_option( 'page_for_posts' ) ) );
|
||||||
$home_url = home_url();
|
$home_url = home_url();
|
||||||
$is_single = is_single();
|
$is_single = is_single();
|
||||||
|
@ -67,7 +68,7 @@ if ( is_active_sidebar( 'hero' ) ) :
|
||||||
);
|
);
|
||||||
|
|
||||||
wp_enqueue_script( 'understrap-slider-script',
|
wp_enqueue_script( 'understrap-slider-script',
|
||||||
get_stylesheet_directory_uri() . '/js/slider_settings.js', array(), '0.5.0' );
|
get_stylesheet_directory_uri() . '/js/slider_settings.js', array() );
|
||||||
wp_localize_script( 'understrap-slider-script', 'understrap_slider_variables', $data );
|
wp_localize_script( 'understrap-slider-script', 'understrap_slider_variables', $data );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue