-
Notifications
You must be signed in to change notification settings - Fork 24
/
functions.php
executable file
·42 lines (36 loc) · 966 Bytes
/
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
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* Theme Functions
*
* Entire theme's function definitions.
*
* @since 1.0.0
* @package WPGulp
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Globals.
define( 'MY_THEME_VER', '1.0.0' );
define( 'MY_THEME_DIR', get_template_directory() );
define( 'MY_THEME_URL', get_template_directory_uri() );
/**
* Scripts & Styles.
*
* Frontend with no conditions, Add Custom styles to wp_head.
*
* @since 1.0.0
*/
function my_theme_styles_scripts() {
// Frontend scripts.
if ( ! is_admin() ) {
// Enqueue vendors first.
wp_enqueue_script( 'vendors', MY_THEME_URL . '/assets/js/vendors.min.js' );
// Enqueue custom JS after vendors.
wp_enqueue_script( 'custom', MY_THEME_URL . '/assets/js/custom.min.js' );
// Minified and Concatenated styles.
wp_enqueue_style( 'styles', MY_THEME_URL . '/style.min.css', array(), MY_THEME_VER, 'all' );
}
}
add_action( 'wp_enqueue_scripts', 'my_theme_styles_scripts' );