Adding dynamic version info behind UnderStrap asset´s URL´s

This commit is contained in:
Holger Könemann 2016-12-01 20:46:15 +01:00
parent c6e0d19cb3
commit 6c32331ade
1 changed files with 8 additions and 7 deletions

View File

@ -5,17 +5,18 @@
* @package understrap
*/
if ( ! function_exists( 'understrap_scripts' ) ) {
/**
* Load theme's JavaScript sources.
*/
function understrap_scripts() {
wp_enqueue_style( 'understrap-styles', get_stylesheet_directory_uri() . '/css/theme.min.css', array(),
'0.5.0' );
// Get the theme data
$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( 'understrap-scripts', get_template_directory_uri() . '/js/theme.min.js', array(), '0.5.0',
true );
wp_enqueue_script( 'understrap-scripts', get_template_directory_uri() . '/js/theme.min.js', array(), $the_theme->get( 'Version' ), true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
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 ) {
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' ) ) );
$home_url = home_url();
$is_single = is_single();
@ -67,7 +68,7 @@ if ( is_active_sidebar( 'hero' ) ) :
);
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 );
}
}