|
@@ -6,11 +6,11 @@ discard block |
|
|
block discarded – undo |
|
6
|
6
|
* @subpackage scripts |
|
7
|
7
|
*/ |
|
8
|
8
|
|
|
9
|
|
-if ( ! defined( 'ABSPATH' ) ) { |
|
|
9
|
+if ( ! defined('ABSPATH')) { |
|
10
|
10
|
exit; |
|
11
|
11
|
} |
|
12
|
12
|
|
|
13
|
|
-if ( ! function_exists( 'lsx_scripts' ) ) : |
|
|
13
|
+if ( ! function_exists('lsx_scripts')) : |
|
14
|
14
|
|
|
15
|
15
|
/** |
|
16
|
16
|
* Enqueue scripts, fonts and styles. |
|
@@ -26,9 +26,9 @@ discard block |
|
|
block discarded – undo |
|
26
|
26
|
|
|
27
|
27
|
endif; |
|
28
|
28
|
|
|
29
|
|
-add_action( 'wp_enqueue_scripts', 'lsx_scripts', 5 ); |
|
|
29
|
+add_action('wp_enqueue_scripts', 'lsx_scripts', 5); |
|
30
|
30
|
|
|
31
|
|
-if ( ! function_exists( 'lsx_admin_scripts' ) ) : |
|
|
31
|
+if ( ! function_exists('lsx_admin_scripts')) : |
|
32
|
32
|
|
|
33
|
33
|
/** |
|
34
|
34
|
* Enqueue scripts (admin). |
|
@@ -37,14 +37,14 @@ discard block |
|
|
block discarded – undo |
|
37
|
37
|
* @subpackage scripts |
|
38
|
38
|
*/ |
|
39
|
39
|
function lsx_admin_scripts() { |
|
40
|
|
- wp_enqueue_script( 'lsx-admin', get_template_directory_uri() . '/assets/js/admin/lsx-admin.js', array( 'jquery' ), LSX_VERSION, true ); |
|
|
40
|
+ wp_enqueue_script('lsx-admin', get_template_directory_uri() . '/assets/js/admin/lsx-admin.js', array('jquery'), LSX_VERSION, true); |
|
41
|
41
|
} |
|
42
|
42
|
|
|
43
|
43
|
endif; |
|
44
|
44
|
|
|
45
|
|
-add_action( 'admin_enqueue_scripts', 'lsx_admin_scripts' ); |
|
|
45
|
+add_action('admin_enqueue_scripts', 'lsx_admin_scripts'); |
|
46
|
46
|
|
|
47
|
|
-if ( ! function_exists( 'lsx_scripts_add_styles' ) ) : |
|
|
47
|
+if ( ! function_exists('lsx_scripts_add_styles')) : |
|
48
|
48
|
|
|
49
|
49
|
/** |
|
50
|
50
|
* Enqueue styles. |
|
@@ -53,23 +53,23 @@ discard block |
|
|
block discarded – undo |
|
53
|
53
|
* @subpackage scripts |
|
54
|
54
|
*/ |
|
55
|
55
|
function lsx_scripts_add_styles() { |
|
56
|
|
- wp_register_style( 'fontawesome', get_template_directory_uri() . '/assets/css/vendor/font-awesome.css', array(), LSX_VERSION ); |
|
57
|
|
- wp_style_add_data( 'fontawesome', 'rtl', 'replace' ); |
|
|
56
|
+ wp_register_style('fontawesome', get_template_directory_uri() . '/assets/css/vendor/font-awesome.css', array(), LSX_VERSION); |
|
|
57
|
+ wp_style_add_data('fontawesome', 'rtl', 'replace'); |
|
58
|
58
|
|
|
59
|
|
- wp_register_style( 'bootstrap', get_template_directory_uri() . '/assets/css/vendor/bootstrap.css', array(), LSX_VERSION ); |
|
60
|
|
- wp_style_add_data( 'bootstrap', 'rtl', 'replace' ); |
|
|
59
|
+ wp_register_style('bootstrap', get_template_directory_uri() . '/assets/css/vendor/bootstrap.css', array(), LSX_VERSION); |
|
|
60
|
+ wp_style_add_data('bootstrap', 'rtl', 'replace'); |
|
61
|
61
|
|
|
62
|
|
- wp_enqueue_style( 'slick', get_template_directory_uri() . '/assets/css/vendor/slick.css', array(), LSX_VERSION, null ); |
|
63
|
|
- wp_enqueue_style( 'slick-lightbox', get_template_directory_uri() . '/assets/css/vendor/slick-lightbox.css', array( 'slick' ), LSX_VERSION, null ); |
|
|
62
|
+ wp_enqueue_style('slick', get_template_directory_uri() . '/assets/css/vendor/slick.css', array(), LSX_VERSION, null); |
|
|
63
|
+ wp_enqueue_style('slick-lightbox', get_template_directory_uri() . '/assets/css/vendor/slick-lightbox.css', array('slick'), LSX_VERSION, null); |
|
64
|
64
|
|
|
65
|
|
- wp_enqueue_style( 'lsx_main_style', get_template_directory_uri() . '/style.css', array(), LSX_VERSION ); |
|
66
|
|
- wp_enqueue_style( 'lsx_main', get_template_directory_uri() . '/assets/css/lsx.css', array( 'lsx_main_style', 'fontawesome', 'bootstrap', 'slick', 'slick-lightbox' ), LSX_VERSION ); |
|
67
|
|
- wp_style_add_data( 'lsx_main', 'rtl', 'replace' ); |
|
|
65
|
+ wp_enqueue_style('lsx_main_style', get_template_directory_uri() . '/style.css', array(), LSX_VERSION); |
|
|
66
|
+ wp_enqueue_style('lsx_main', get_template_directory_uri() . '/assets/css/lsx.css', array('lsx_main_style', 'fontawesome', 'bootstrap', 'slick', 'slick-lightbox'), LSX_VERSION); |
|
|
67
|
+ wp_style_add_data('lsx_main', 'rtl', 'replace'); |
|
68
|
68
|
} |
|
69
|
69
|
|
|
70
|
70
|
endif; |
|
71
|
71
|
|
|
72
|
|
-if ( ! function_exists( 'lsx_scripts_add_fonts' ) ) : |
|
|
72
|
+if ( ! function_exists('lsx_scripts_add_fonts')) : |
|
73
|
73
|
|
|
74
|
74
|
/** |
|
75
|
75
|
* Enqueue fonts. |
|
@@ -79,8 +79,8 @@ discard block |
|
|
block discarded – undo |
|
79
|
79
|
*/ |
|
80
|
80
|
function lsx_scripts_add_fonts() { |
|
81
|
81
|
|
|
82
|
|
- $disable_fonts = get_theme_mod( 'lsx_disable_fonts', false ); |
|
83
|
|
- if ( false !== $disable_fonts ) { |
|
|
82
|
+ $disable_fonts = get_theme_mod('lsx_disable_fonts', false); |
|
|
83
|
+ if (false !== $disable_fonts) { |
|
84
|
84
|
return; |
|
85
|
85
|
} |
|
86
|
86
|
|
|
@@ -145,14 +145,14 @@ discard block |
|
|
block discarded – undo |
|
145
|
145
|
.single-testimonial .entry-content:before{font-family:\'Lora\',serif} |
|
146
|
146
|
'; |
|
147
|
147
|
|
|
148
|
|
- if ( ! empty( $font_styles ) ) { |
|
149
|
|
- wp_add_inline_style( 'lsx_main', $font_styles ); |
|
|
148
|
+ if ( ! empty($font_styles)) { |
|
|
149
|
+ wp_add_inline_style('lsx_main', $font_styles); |
|
150
|
150
|
} |
|
151
|
151
|
} |
|
152
|
152
|
|
|
153
|
153
|
endif; |
|
154
|
154
|
|
|
155
|
|
-if ( ! function_exists( 'lsx_scripts_add_scripts' ) ) : |
|
|
155
|
+if ( ! function_exists('lsx_scripts_add_scripts')) : |
|
156
|
156
|
|
|
157
|
157
|
/** |
|
158
|
158
|
* Enqueue scripts. |
|
@@ -161,31 +161,31 @@ discard block |
|
|
block discarded – undo |
|
161
|
161
|
* @subpackage scripts |
|
162
|
162
|
*/ |
|
163
|
163
|
function lsx_scripts_add_scripts() { |
|
164
|
|
- if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { |
|
165
|
|
- wp_enqueue_script( 'comment-reply' ); |
|
|
164
|
+ if (is_singular() && comments_open() && get_option('thread_comments')) { |
|
|
165
|
+ wp_enqueue_script('comment-reply'); |
|
166
|
166
|
} |
|
167
|
167
|
|
|
168
|
|
- wp_enqueue_script( 'platform', get_template_directory_uri() . '/assets/js/vendor/platform.min.js', array(), LSX_VERSION, true ); |
|
169
|
|
- wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/js/vendor/bootstrap.min.js', array( 'jquery' ), LSX_VERSION, true ); |
|
|
168
|
+ wp_enqueue_script('platform', get_template_directory_uri() . '/assets/js/vendor/platform.min.js', array(), LSX_VERSION, true); |
|
|
169
|
+ wp_enqueue_script('bootstrap', get_template_directory_uri() . '/assets/js/vendor/bootstrap.min.js', array('jquery'), LSX_VERSION, true); |
|
170
|
170
|
|
|
171
|
|
- wp_enqueue_script( 'imagesLoaded', get_template_directory_uri() . '/assets/js/vendor/imagesloaded.pkgd.min.js', array( 'masonry' ), LSX_VERSION, true ); |
|
172
|
|
- wp_enqueue_script( 'scrolltofixed', get_template_directory_uri() . '/assets/js/vendor/jquery-scrolltofixed-min.js', array( 'jquery' ), LSX_VERSION, true ); |
|
173
|
|
- wp_enqueue_script( 'slick', get_template_directory_uri() . '/assets/js/vendor/slick.min.js', array( 'jquery' ), LSX_VERSION, true ); |
|
174
|
|
- wp_enqueue_script( 'slick-lightbox', get_template_directory_uri() . '/assets/js/vendor/slick-lightbox.min.js', array( 'jquery', 'slick' ), LSX_VERSION, true ); |
|
175
|
|
- wp_enqueue_script( 'picturefill', get_template_directory_uri() . '/assets/js/vendor/picturefill.min.js', array(), LSX_VERSION, true ); |
|
|
171
|
+ wp_enqueue_script('imagesLoaded', get_template_directory_uri() . '/assets/js/vendor/imagesloaded.pkgd.min.js', array('masonry'), LSX_VERSION, true); |
|
|
172
|
+ wp_enqueue_script('scrolltofixed', get_template_directory_uri() . '/assets/js/vendor/jquery-scrolltofixed-min.js', array('jquery'), LSX_VERSION, true); |
|
|
173
|
+ wp_enqueue_script('slick', get_template_directory_uri() . '/assets/js/vendor/slick.min.js', array('jquery'), LSX_VERSION, true); |
|
|
174
|
+ wp_enqueue_script('slick-lightbox', get_template_directory_uri() . '/assets/js/vendor/slick-lightbox.min.js', array('jquery', 'slick'), LSX_VERSION, true); |
|
|
175
|
+ wp_enqueue_script('picturefill', get_template_directory_uri() . '/assets/js/vendor/picturefill.min.js', array(), LSX_VERSION, true); |
|
176
|
176
|
|
|
177
|
|
- wp_enqueue_script( 'lsx_script', get_template_directory_uri() . '/assets/js/lsx.min.js', array( 'jquery', 'platform', 'bootstrap', 'masonry', 'imagesLoaded', 'scrolltofixed', 'slick', 'slick-lightbox', 'picturefill' ), LSX_VERSION, true ); |
|
|
177
|
+ wp_enqueue_script('lsx_script', get_template_directory_uri() . '/assets/js/lsx.min.js', array('jquery', 'platform', 'bootstrap', 'masonry', 'imagesLoaded', 'scrolltofixed', 'slick', 'slick-lightbox', 'picturefill'), LSX_VERSION, true); |
|
178
|
178
|
|
|
179
|
179
|
$param_array = array( |
|
180
|
|
- 'columns' => apply_filters( 'lsx_archive_column_number', 3 ), |
|
|
180
|
+ 'columns' => apply_filters('lsx_archive_column_number', 3), |
|
181
|
181
|
); |
|
182
|
182
|
|
|
183
|
|
- wp_localize_script( 'lsx_script', 'lsx_params', $param_array ); |
|
|
183
|
+ wp_localize_script('lsx_script', 'lsx_params', $param_array); |
|
184
|
184
|
} |
|
185
|
185
|
|
|
186
|
186
|
endif; |
|
187
|
187
|
|
|
188
|
|
-if ( ! function_exists( 'lsx_scripts_child_theme' ) ) : |
|
|
188
|
+if ( ! function_exists('lsx_scripts_child_theme')) : |
|
189
|
189
|
|
|
190
|
190
|
/** |
|
191
|
191
|
* Enqueue scripts and styles (for child theme). |
|
@@ -194,12 +194,12 @@ discard block |
|
|
block discarded – undo |
|
194
|
194
|
* @subpackage scripts |
|
195
|
195
|
*/ |
|
196
|
196
|
function lsx_scripts_child_theme() { |
|
197
|
|
- if ( is_child_theme() && file_exists( get_stylesheet_directory() . '/assets/css/custom.css' ) ) { |
|
198
|
|
- wp_enqueue_style( 'child-css', get_stylesheet_directory_uri() . '/assets/css/custom.css', array( 'lsx_main' ), LSX_VERSION ); |
|
199
|
|
- wp_style_add_data( 'child-css', 'rtl', 'replace' ); |
|
|
197
|
+ if (is_child_theme() && file_exists(get_stylesheet_directory() . '/assets/css/custom.css')) { |
|
|
198
|
+ wp_enqueue_style('child-css', get_stylesheet_directory_uri() . '/assets/css/custom.css', array('lsx_main'), LSX_VERSION); |
|
|
199
|
+ wp_style_add_data('child-css', 'rtl', 'replace'); |
|
200
|
200
|
} |
|
201
|
201
|
} |
|
202
|
202
|
|
|
203
|
203
|
endif; |
|
204
|
204
|
|
|
205
|
|
-add_action( 'wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999 ); |
|
|
205
|
+add_action('wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999); |