-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
functions.php
31 lines (23 loc) · 1.03 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/**
* @package Bootscore Child
*
* @version 6.0.0
*/
// Exit if accessed directly
defined('ABSPATH') || exit;
/**
* Enqueue scripts and styles
*/
add_action('wp_enqueue_scripts', 'bootscore_child_enqueue_styles');
function bootscore_child_enqueue_styles() {
// Compiled main.css
$modified_bootscoreChildCss = date('YmdHi', filemtime(get_stylesheet_directory() . '/assets/css/main.css'));
wp_enqueue_style('main', get_stylesheet_directory_uri() . '/assets/css/main.css', array('parent-style'), $modified_bootscoreChildCss);
// style.css
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
// custom.js
// Get modification time. Enqueue file with modification date to prevent browser from loading cached scripts when file content changes.
$modificated_CustomJS = date('YmdHi', filemtime(get_stylesheet_directory() . '/assets/js/custom.js'));
wp_enqueue_script('custom-js', get_stylesheet_directory_uri() . '/assets/js/custom.js', array('jquery'), $modificated_CustomJS, false, true);
}