@@ -9,33 +9,33 @@ discard block |
||
9 | 9 | |
10 | 10 | <?php lsx_content_wrap_before(); ?> |
11 | 11 | |
12 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
12 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
13 | 13 | |
14 | 14 | <?php lsx_content_before(); ?> |
15 | 15 | |
16 | 16 | <main id="main" class="site-main"> |
17 | 17 | |
18 | 18 | <?php |
19 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
20 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
21 | - if('1c' === $layout){ |
|
19 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
20 | + $layout = apply_filters('lsx_layout', $layout); |
|
21 | + if ('1c' === $layout) { |
|
22 | 22 | lsx_breadcrumbs(); |
23 | 23 | } |
24 | 24 | ?> |
25 | 25 | |
26 | 26 | <?php lsx_content_top(); ?> |
27 | 27 | |
28 | - <?php if ( have_posts() ) : global $lsx_archive; $lsx_archive = 1; ?> |
|
28 | + <?php if (have_posts()) : global $lsx_archive; $lsx_archive = 1; ?> |
|
29 | 29 | |
30 | 30 | <?php /* Start the Loop */ ?> |
31 | - <?php while ( have_posts() ) : the_post(); ?> |
|
31 | + <?php while (have_posts()) : the_post(); ?> |
|
32 | 32 | |
33 | 33 | <?php |
34 | 34 | /* Include the Post-Format-specific template for the content. |
35 | 35 | * If you want to override this in a child theme, then include a file |
36 | 36 | * called content-___.php (where ___ is the Post Format name) and that will be used instead. |
37 | 37 | */ |
38 | - get_template_part( 'content', get_post_format() ); |
|
38 | + get_template_part('content', get_post_format()); |
|
39 | 39 | ?> |
40 | 40 | |
41 | 41 | <?php endwhile; ?> |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | <?php else : ?> |
46 | 46 | |
47 | - <?php get_template_part( 'content', 'none' ); ?> |
|
47 | + <?php get_template_part('content', 'none'); ?> |
|
48 | 48 | |
49 | 49 | <?php endif; $lsx_archive = 0; ?> |
50 | 50 |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Enable extra attributes (srcset, sizes) in img tag |
6 | 6 | */ |
7 | -function lsx_kses_allowed_html( $allowedtags, $context ) { |
|
7 | +function lsx_kses_allowed_html($allowedtags, $context) { |
|
8 | 8 | $allowedtags['img']['srcset'] = true; |
9 | 9 | $allowedtags['img']['sizes'] = true; |
10 | 10 | |
11 | 11 | return $allowedtags; |
12 | 12 | } |
13 | -add_filter( 'wp_kses_allowed_html', 'lsx_kses_allowed_html', 10, 2 ); |
|
13 | +add_filter('wp_kses_allowed_html', 'lsx_kses_allowed_html', 10, 2); |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * Add and remove body_class() classes |
@@ -19,21 +19,21 @@ discard block |
||
19 | 19 | /* |
20 | 20 | * Add the header layout class |
21 | 21 | */ |
22 | - $header_layout = get_theme_mod('lsx_header_layout','inline'); |
|
23 | - $classes[] = 'header-'.$header_layout; |
|
22 | + $header_layout = get_theme_mod('lsx_header_layout', 'inline'); |
|
23 | + $classes[] = 'header-' . $header_layout; |
|
24 | 24 | |
25 | 25 | |
26 | 26 | // Add post/page slug |
27 | - if (is_single() || is_page() && !is_front_page()) { |
|
27 | + if (is_single() || is_page() && ! is_front_page()) { |
|
28 | 28 | $classes[] = basename(get_permalink()); |
29 | 29 | } |
30 | 30 | |
31 | - if(!class_exists('Lsx_Banners')){ |
|
32 | - $post_types = array('page','post'); |
|
33 | - $post_types = apply_filters('lsx_allowed_post_type_banners',$post_types); |
|
31 | + if ( ! class_exists('Lsx_Banners')) { |
|
32 | + $post_types = array('page', 'post'); |
|
33 | + $post_types = apply_filters('lsx_allowed_post_type_banners', $post_types); |
|
34 | 34 | |
35 | - if((is_singular($post_types) && has_post_thumbnail()) |
|
36 | - || (is_singular('jetpack-portfolio'))){ |
|
35 | + if ((is_singular($post_types) && has_post_thumbnail()) |
|
36 | + || (is_singular('jetpack-portfolio'))) { |
|
37 | 37 | $classes[] = 'page-has-banner'; |
38 | 38 | } |
39 | 39 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $classes[] = 'has-top-menu'; |
43 | 43 | } |
44 | 44 | |
45 | - if ( get_theme_mod( 'lsx_preloader_content_status', '1' ) === '1' ) { |
|
45 | + if (get_theme_mod('lsx_preloader_content_status', '1') === '1') { |
|
46 | 46 | $classes[] = 'preloader-content-enable'; |
47 | 47 | } |
48 | 48 | |
@@ -66,30 +66,30 @@ discard block |
||
66 | 66 | * @param string $sep Optional separator. |
67 | 67 | * @return string The filtered title. |
68 | 68 | */ |
69 | -function lsx_wp_title( $title, $sep ) { |
|
69 | +function lsx_wp_title($title, $sep) { |
|
70 | 70 | global $page, $paged; |
71 | 71 | |
72 | - if ( is_feed() ) { |
|
72 | + if (is_feed()) { |
|
73 | 73 | return $title; |
74 | 74 | } |
75 | 75 | |
76 | 76 | // Add the blog name |
77 | - $title .= get_bloginfo( 'name' ); |
|
77 | + $title .= get_bloginfo('name'); |
|
78 | 78 | |
79 | 79 | // Add the blog description for the home/front page. |
80 | - $site_description = get_bloginfo( 'description', 'display' ); |
|
81 | - if ( $site_description && ( is_home() || is_front_page() ) ) { |
|
80 | + $site_description = get_bloginfo('description', 'display'); |
|
81 | + if ($site_description && (is_home() || is_front_page())) { |
|
82 | 82 | $title .= " $sep $site_description"; |
83 | 83 | } |
84 | 84 | |
85 | 85 | // Add a page number if necessary: |
86 | - if ( $paged >= 2 || $page >= 2 ) { |
|
87 | - $title .= " $sep " . sprintf( __( 'Page %s', 'lsx' ), max( $paged, $page ) ); |
|
86 | + if ($paged >= 2 || $page >= 2) { |
|
87 | + $title .= " $sep " . sprintf(__('Page %s', 'lsx'), max($paged, $page)); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | return $title; |
91 | 91 | } |
92 | -add_filter( 'wp_title', 'lsx_wp_title', 10, 2 ); |
|
92 | +add_filter('wp_title', 'lsx_wp_title', 10, 2); |
|
93 | 93 | |
94 | 94 | |
95 | 95 | /** |
@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | function lsx_remove_self_closing_tags($input) { |
111 | 111 | return str_replace(' />', '>', $input); |
112 | 112 | } |
113 | -add_filter('get_avatar', 'lsx_remove_self_closing_tags'); // <img /> |
|
114 | -add_filter('comment_id_fields', 'lsx_remove_self_closing_tags'); // <input /> |
|
113 | +add_filter('get_avatar', 'lsx_remove_self_closing_tags'); // <img /> |
|
114 | +add_filter('comment_id_fields', 'lsx_remove_self_closing_tags'); // <input /> |
|
115 | 115 | add_filter('post_thumbnail_html', 'lsx_remove_self_closing_tags'); // <img /> |
116 | 116 | |
117 | 117 | |
118 | -if (!function_exists('lsx_get_attachment_id')) { |
|
118 | +if ( ! function_exists('lsx_get_attachment_id')) { |
|
119 | 119 | /** |
120 | 120 | * Get the Attachment ID for a given image URL. |
121 | 121 | * |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | function lsx_get_attachment_id($url) { |
127 | 127 | $dir = wp_upload_dir(); |
128 | 128 | // baseurl never has a trailing slash |
129 | - if (false === strpos($url, $dir['baseurl'].'/')) { |
|
129 | + if (false === strpos($url, $dir['baseurl'] . '/')) { |
|
130 | 130 | // URL points to a place outside of upload directory |
131 | 131 | return false; |
132 | 132 | } |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | $query['meta_query'][0]['key'] = '_wp_attached_file'; |
145 | 145 | // query attachments |
146 | 146 | $ids = get_posts($query); |
147 | - if (!empty($ids)) { |
|
147 | + if ( ! empty($ids)) { |
|
148 | 148 | foreach ($ids as $id) { |
149 | 149 | // first entry of returned array is the URL |
150 | - $temp_url = wp_get_attachment_image_src( $id, 'full' ); |
|
151 | - if ( array_shift( $temp_url ) === $url ) { |
|
150 | + $temp_url = wp_get_attachment_image_src($id, 'full'); |
|
151 | + if (array_shift($temp_url) === $url) { |
|
152 | 152 | return $id; |
153 | 153 | } |
154 | 154 | } |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | } |
162 | 162 | foreach ($ids as $id) { |
163 | 163 | $meta = wp_get_attachment_metadata($id); |
164 | - foreach ( $meta['sizes'] as $size => $values ) { |
|
165 | - if ( $values['file'] === $file && array_shift( wp_get_attachment_image_src( $id, $size ) ) === $url ) { |
|
164 | + foreach ($meta['sizes'] as $size => $values) { |
|
165 | + if ($values['file'] === $file && array_shift(wp_get_attachment_image_src($id, $size)) === $url) { |
|
166 | 166 | return $id; |
167 | 167 | } |
168 | 168 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | */ |
188 | 188 | function lsx_is_element_empty($element) { |
189 | 189 | $element = trim($element); |
190 | - return empty($element)?false:true; |
|
190 | + return empty($element) ? false : true; |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | |
@@ -198,39 +198,39 @@ discard block |
||
198 | 198 | * @subpackage extras |
199 | 199 | * @category thumbnails |
200 | 200 | */ |
201 | -function lsx_get_thumbnail($size,$image_src = false){ |
|
201 | +function lsx_get_thumbnail($size, $image_src = false) { |
|
202 | 202 | |
203 | - if(false === $image_src){ |
|
203 | + if (false === $image_src) { |
|
204 | 204 | $post_id = get_the_ID(); |
205 | - $post_thumbnail_id = get_post_thumbnail_id( $post_id ); |
|
206 | - }elseif(false != $image_src ){ |
|
207 | - if(is_numeric($image_src)){ |
|
205 | + $post_thumbnail_id = get_post_thumbnail_id($post_id); |
|
206 | + }elseif (false != $image_src) { |
|
207 | + if (is_numeric($image_src)) { |
|
208 | 208 | $post_thumbnail_id = $image_src; |
209 | - }else{ |
|
209 | + } else { |
|
210 | 210 | $post_thumbnail_id = lsx_get_attachment_id_from_src($image_src); |
211 | 211 | } |
212 | 212 | } |
213 | - $size = apply_filters('lsx_thumbnail_size',$size); |
|
213 | + $size = apply_filters('lsx_thumbnail_size', $size); |
|
214 | 214 | $img = false; |
215 | - if ( 'lsx-thumbnail-wide' === $size || 'thumbnail' === $size ) { |
|
215 | + if ('lsx-thumbnail-wide' === $size || 'thumbnail' === $size) { |
|
216 | 216 | $srcset = false; |
217 | - $img = wp_get_attachment_image_src($post_thumbnail_id,$size); |
|
217 | + $img = wp_get_attachment_image_src($post_thumbnail_id, $size); |
|
218 | 218 | $img = $img[0]; |
219 | 219 | } else { |
220 | 220 | $srcset = true; |
221 | - $img = wp_get_attachment_image_srcset($post_thumbnail_id,$size); |
|
222 | - if ( false == $img ) { |
|
221 | + $img = wp_get_attachment_image_srcset($post_thumbnail_id, $size); |
|
222 | + if (false == $img) { |
|
223 | 223 | $srcset = false; |
224 | - $img = wp_get_attachment_image_src($post_thumbnail_id,$size); |
|
224 | + $img = wp_get_attachment_image_src($post_thumbnail_id, $size); |
|
225 | 225 | $img = $img[0]; |
226 | 226 | } |
227 | 227 | } |
228 | - if ( $srcset ) { |
|
229 | - $img = '<img alt="'.get_the_title(get_the_ID()).'" class="attachment-responsive wp-post-image lsx-responsive" srcset="'.$img.'" />'; |
|
228 | + if ($srcset) { |
|
229 | + $img = '<img alt="' . get_the_title(get_the_ID()) . '" class="attachment-responsive wp-post-image lsx-responsive" srcset="' . $img . '" />'; |
|
230 | 230 | } else { |
231 | - $img = '<img alt="'.get_the_title(get_the_ID()).'" class="attachment-responsive wp-post-image lsx-responsive" src="'.$img.'" />'; |
|
231 | + $img = '<img alt="' . get_the_title(get_the_ID()) . '" class="attachment-responsive wp-post-image lsx-responsive" src="' . $img . '" />'; |
|
232 | 232 | } |
233 | - $img = apply_filters('lsx_lazyload_filter_images',$img); |
|
233 | + $img = apply_filters('lsx_lazyload_filter_images', $img); |
|
234 | 234 | return $img; |
235 | 235 | } |
236 | 236 | |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | * @subpackage extras |
242 | 242 | * @category thumbnails |
243 | 243 | */ |
244 | -function lsx_thumbnail( $size = 'thumbnail', $image_src = false ) { |
|
245 | - echo wp_kses_post( lsx_get_thumbnail( $size, $image_src ) ); |
|
244 | +function lsx_thumbnail($size = 'thumbnail', $image_src = false) { |
|
245 | + echo wp_kses_post(lsx_get_thumbnail($size, $image_src)); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | |
@@ -252,13 +252,13 @@ discard block |
||
252 | 252 | * @subpackage extras |
253 | 253 | * @category thumbnails |
254 | 254 | */ |
255 | -function lsx_get_attachment_id_from_src( $image_src ) { |
|
256 | - $post_id = wp_cache_get( $image_src, 'lsx_get_attachment_id_from_src' ); |
|
255 | +function lsx_get_attachment_id_from_src($image_src) { |
|
256 | + $post_id = wp_cache_get($image_src, 'lsx_get_attachment_id_from_src'); |
|
257 | 257 | |
258 | - if ( false === $post_id ) { |
|
258 | + if (false === $post_id) { |
|
259 | 259 | global $wpdb; |
260 | - $post_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src ) ); |
|
261 | - wp_cache_set( $image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600 ); |
|
260 | + $post_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src)); |
|
261 | + wp_cache_set($image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | return $post_id; |
@@ -272,28 +272,28 @@ discard block |
||
272 | 272 | * @subpackage extras |
273 | 273 | * @category banner |
274 | 274 | */ |
275 | -if (!function_exists('lsx_page_banner')) { |
|
275 | +if ( ! function_exists('lsx_page_banner')) { |
|
276 | 276 | function lsx_page_banner() { |
277 | 277 | |
278 | - $post_types = array('page','post'); |
|
279 | - $post_types = apply_filters('lsx_allowed_post_type_banners',$post_types); |
|
278 | + $post_types = array('page', 'post'); |
|
279 | + $post_types = apply_filters('lsx_allowed_post_type_banners', $post_types); |
|
280 | 280 | |
281 | - if ( (is_singular($post_types) && has_post_thumbnail()) |
|
282 | - || (is_singular('jetpack-portfolio')) ) { ?> |
|
281 | + if ((is_singular($post_types) && has_post_thumbnail()) |
|
282 | + || (is_singular('jetpack-portfolio'))) { ?> |
|
283 | 283 | |
284 | 284 | <?php |
285 | 285 | $bg_image = ''; |
286 | - if(has_post_thumbnail()){ |
|
287 | - $bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),'full'); |
|
286 | + if (has_post_thumbnail()) { |
|
287 | + $bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full'); |
|
288 | 288 | $bg_image = $bg_image[0]; |
289 | 289 | } |
290 | 290 | ?> |
291 | 291 | |
292 | - <?php if ( ! empty( $bg_image ) ) : ?> |
|
292 | + <?php if ( ! empty($bg_image)) : ?> |
|
293 | 293 | |
294 | 294 | <div class="page-banner-wrap"> |
295 | 295 | <div class="page-banner"> |
296 | - <div class="page-banner-image" style="background-image:url(<?php echo esc_attr( $bg_image ); ?>);"></div> |
|
296 | + <div class="page-banner-image" style="background-image:url(<?php echo esc_attr($bg_image); ?>);"></div> |
|
297 | 297 | |
298 | 298 | <div class="container"> |
299 | 299 | <header class="page-header"> |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | <?php } |
310 | 310 | } |
311 | 311 | } |
312 | -add_action( 'lsx_header_after', 'lsx_page_banner' ); |
|
312 | +add_action('lsx_header_after', 'lsx_page_banner'); |
|
313 | 313 | |
314 | 314 | |
315 | 315 | /** |
@@ -319,43 +319,43 @@ discard block |
||
319 | 319 | * @subpackage extras |
320 | 320 | * @category mobile |
321 | 321 | */ |
322 | -function lsx_allow_sms_protocol( $protocols ) { |
|
322 | +function lsx_allow_sms_protocol($protocols) { |
|
323 | 323 | $protocols[] = 'sms'; |
324 | 324 | return $protocols; |
325 | 325 | } |
326 | -add_filter( 'kses_allowed_protocols', 'lsx_allow_sms_protocol' ); |
|
326 | +add_filter('kses_allowed_protocols', 'lsx_allow_sms_protocol'); |
|
327 | 327 | |
328 | 328 | |
329 | 329 | /** |
330 | 330 | * Adding browser and user-agent classes to body |
331 | 331 | */ |
332 | 332 | function mv_browser_body_class($classes) { |
333 | - $http_user_agent = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); |
|
334 | - $http_user_agent = ! empty( $http_user_agent ) ? $http_user_agent : ''; |
|
333 | + $http_user_agent = sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT'])); |
|
334 | + $http_user_agent = ! empty($http_user_agent) ? $http_user_agent : ''; |
|
335 | 335 | |
336 | 336 | global $is_lynx, $is_gecko, $is_ie, $is_opera, $is_ns4, $is_safari, $is_chrome, $is_iphone; |
337 | - if($is_lynx) $classes[] = 'lynx'; |
|
338 | - elseif($is_gecko) $classes[] = 'gecko'; |
|
339 | - elseif($is_opera) $classes[] = 'opera'; |
|
340 | - elseif($is_ns4) $classes[] = 'ns4'; |
|
341 | - elseif($is_safari) $classes[] = 'safari'; |
|
342 | - elseif($is_chrome) $classes[] = 'chrome'; |
|
343 | - elseif($is_ie) { |
|
337 | + if ($is_lynx) $classes[] = 'lynx'; |
|
338 | + elseif ($is_gecko) $classes[] = 'gecko'; |
|
339 | + elseif ($is_opera) $classes[] = 'opera'; |
|
340 | + elseif ($is_ns4) $classes[] = 'ns4'; |
|
341 | + elseif ($is_safari) $classes[] = 'safari'; |
|
342 | + elseif ($is_chrome) $classes[] = 'chrome'; |
|
343 | + elseif ($is_ie) { |
|
344 | 344 | $classes[] = 'ie'; |
345 | - if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $http_user_agent, $browser_version)) |
|
346 | - $classes[] = 'ie'.$browser_version[1]; |
|
345 | + if (preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $http_user_agent, $browser_version)) |
|
346 | + $classes[] = 'ie' . $browser_version[1]; |
|
347 | 347 | } else $classes[] = 'unknown'; |
348 | - if($is_iphone) $classes[] = 'iphone'; |
|
349 | - if ( stristr( $http_user_agent, "mac") ) { |
|
348 | + if ($is_iphone) $classes[] = 'iphone'; |
|
349 | + if (stristr($http_user_agent, "mac")) { |
|
350 | 350 | $classes[] = 'osx'; |
351 | - } elseif ( stristr( $http_user_agent, "linux") ) { |
|
351 | + } elseif (stristr($http_user_agent, "linux")) { |
|
352 | 352 | $classes[] = 'linux'; |
353 | - } elseif ( stristr( $http_user_agent, "windows") ) { |
|
353 | + } elseif (stristr($http_user_agent, "windows")) { |
|
354 | 354 | $classes[] = 'windows'; |
355 | 355 | } |
356 | 356 | return $classes; |
357 | 357 | } |
358 | -add_filter('body_class','mv_browser_body_class'); |
|
358 | +add_filter('body_class', 'mv_browser_body_class'); |
|
359 | 359 | |
360 | 360 | |
361 | 361 | /** |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | * @param $form Object |
369 | 369 | * @return String |
370 | 370 | */ |
371 | -function lsx_form_submit_button($button, $form){ |
|
371 | +function lsx_form_submit_button($button, $form) { |
|
372 | 372 | return "<button class='btn btn-primary' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>"; |
373 | 373 | } |
374 | 374 | add_filter("gform_submit_button", "lsx_form_submit_button", 10, 2); |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | //return ' ... <a class="moretag" href="'. get_permalink($post->ID) . '">'.esc_html__('Continue reading','lsx').'</a>'; |
383 | 383 | return '...'; |
384 | 384 | } |
385 | -add_filter( 'excerpt_more', 'lsx_excerpt_more' ); |
|
385 | +add_filter('excerpt_more', 'lsx_excerpt_more'); |
|
386 | 386 | |
387 | 387 | |
388 | 388 | /** |
@@ -391,44 +391,44 @@ discard block |
||
391 | 391 | function lsx_the_excerpt_filter($excerpt) { |
392 | 392 | $show_full_content = has_post_format(apply_filters('lsx_the_excerpt_filter_post_types', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio'))); |
393 | 393 | |
394 | - if (!$show_full_content) { |
|
395 | - if ('' !== $excerpt && !stristr($excerpt, 'moretag')) { |
|
396 | - $pagination = wp_link_pages( array( |
|
394 | + if ( ! $show_full_content) { |
|
395 | + if ('' !== $excerpt && ! stristr($excerpt, 'moretag')) { |
|
396 | + $pagination = wp_link_pages(array( |
|
397 | 397 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
398 | 398 | 'after' => '</div></div>', |
399 | 399 | 'link_before' => '<span>', |
400 | 400 | 'link_after' => '</span>', |
401 | 401 | 'echo' => 0 |
402 | - ) ); |
|
402 | + )); |
|
403 | 403 | |
404 | - if ( ! empty( $pagination ) ) { |
|
404 | + if ( ! empty($pagination)) { |
|
405 | 405 | $excerpt .= $pagination; |
406 | 406 | } |
407 | 407 | else { |
408 | - $excerpt .= '<p><a class="moretag" href="'.get_permalink().'">'.esc_html__('Continue reading','lsx').'</a></p>'; |
|
408 | + $excerpt .= '<p><a class="moretag" href="' . get_permalink() . '">' . esc_html__('Continue reading', 'lsx') . '</a></p>'; |
|
409 | 409 | } |
410 | 410 | } |
411 | 411 | } |
412 | 412 | |
413 | 413 | return $excerpt; |
414 | 414 | } |
415 | -add_filter( 'the_excerpt', 'lsx_the_excerpt_filter' , 1 , 20 ); |
|
415 | +add_filter('the_excerpt', 'lsx_the_excerpt_filter', 1, 20); |
|
416 | 416 | |
417 | 417 | |
418 | 418 | /** |
419 | 419 | * Allow HTML tags in excerpt |
420 | 420 | */ |
421 | -if ( ! function_exists( 'wpse_custom_wp_trim_excerpt' ) ) { |
|
421 | +if ( ! function_exists('wpse_custom_wp_trim_excerpt')) { |
|
422 | 422 | function wpse_custom_wp_trim_excerpt($wpse_excerpt) { |
423 | 423 | global $post; |
424 | 424 | $raw_excerpt = $wpse_excerpt; |
425 | 425 | |
426 | - if ( '' == $wpse_excerpt ) { |
|
426 | + if ('' == $wpse_excerpt) { |
|
427 | 427 | $wpse_excerpt = get_the_content(''); |
428 | 428 | $show_full_content = has_post_format(array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio')); |
429 | 429 | |
430 | - if (!$show_full_content) { |
|
431 | - $wpse_excerpt = strip_shortcodes( $wpse_excerpt ); |
|
430 | + if ( ! $show_full_content) { |
|
431 | + $wpse_excerpt = strip_shortcodes($wpse_excerpt); |
|
432 | 432 | $wpse_excerpt = apply_filters('the_content', $wpse_excerpt); |
433 | 433 | $wpse_excerpt = str_replace(']]>', ']]>', $wpse_excerpt); |
434 | 434 | $wpse_excerpt = strip_tags($wpse_excerpt, '<blockquote>,<p>,<br>,<b>,<strong>,<i>,<u>,<ul>,<li>,<span>,<div>'); |
@@ -456,12 +456,12 @@ discard block |
||
456 | 456 | $wpse_excerpt = trim(force_balance_tags($excerpt_output)); |
457 | 457 | |
458 | 458 | if ($has_more) { |
459 | - $excerpt_end = '<a class="moretag" href="'.get_permalink().'">'.esc_html__('More','lsx').'</a>'; |
|
459 | + $excerpt_end = '<a class="moretag" href="' . get_permalink() . '">' . esc_html__('More', 'lsx') . '</a>'; |
|
460 | 460 | $excerpt_end = apply_filters('excerpt_more', ' ' . $excerpt_end); |
461 | 461 | |
462 | 462 | $pos = strrpos($wpse_excerpt, '</'); |
463 | 463 | |
464 | - if ( false !== $pos ) { |
|
464 | + if (false !== $pos) { |
|
465 | 465 | // Inside last HTML tag |
466 | 466 | $wpse_excerpt = substr_replace($wpse_excerpt, $excerpt_end, $pos, 0); /* Add read more next to last word */ |
467 | 467 | } else { |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Theme Configuration File |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @package lsx |
9 | 9 | */ |
10 | 10 | |
11 | -if ( ! function_exists( 'lsx_setup' ) ) : |
|
11 | +if ( ! function_exists('lsx_setup')) : |
|
12 | 12 | /** |
13 | 13 | * Sets up theme defaults and registers support for various WordPress features. |
14 | 14 | * |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | function lsx_setup() { |
20 | 20 | global $content_width; |
21 | 21 | |
22 | - load_theme_textdomain( 'lsx', get_template_directory() . '/languages' ); |
|
22 | + load_theme_textdomain('lsx', get_template_directory() . '/languages'); |
|
23 | 23 | |
24 | 24 | $args = array( |
25 | 25 | 'header-text' => array( |
@@ -28,68 +28,68 @@ discard block |
||
28 | 28 | ), |
29 | 29 | 'size' => 'medium', |
30 | 30 | ); |
31 | - add_theme_support( 'site-logo', $args ); |
|
31 | + add_theme_support('site-logo', $args); |
|
32 | 32 | |
33 | - add_theme_support( 'custom-logo', array( |
|
33 | + add_theme_support('custom-logo', array( |
|
34 | 34 | 'height' => 50, |
35 | 35 | 'width' => 150, |
36 | 36 | 'flex-width' => true, |
37 | 37 | 'flex-height' => true, |
38 | - ) ); |
|
38 | + )); |
|
39 | 39 | |
40 | - add_theme_support( 'custom-background' ); |
|
41 | - add_theme_support( 'automatic-feed-links' ); |
|
42 | - add_theme_support( 'title-tag' ); |
|
43 | - add_theme_support( 'post-thumbnails' ); |
|
44 | - add_theme_support( 'post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside') ); |
|
40 | + add_theme_support('custom-background'); |
|
41 | + add_theme_support('automatic-feed-links'); |
|
42 | + add_theme_support('title-tag'); |
|
43 | + add_theme_support('post-thumbnails'); |
|
44 | + add_theme_support('post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside')); |
|
45 | 45 | |
46 | 46 | // This theme uses wp_nav_menu() in one location. |
47 | - register_nav_menus( array( |
|
48 | - 'primary' => esc_html__( 'Primary Menu', 'lsx' ), |
|
49 | - 'top-menu'=> esc_html__( 'Top Menu (right)' , 'lsx' ), |
|
50 | - 'top-menu-left'=> esc_html__( 'Top Menu (left)' , 'lsx' ), |
|
51 | - 'social'=> esc_html__( 'Social Menu' , 'lsx' ), |
|
52 | - 'footer'=> esc_html__( 'Footer Menu' , 'lsx' ) |
|
53 | - ) ); |
|
47 | + register_nav_menus(array( |
|
48 | + 'primary' => esc_html__('Primary Menu', 'lsx'), |
|
49 | + 'top-menu'=> esc_html__('Top Menu (right)', 'lsx'), |
|
50 | + 'top-menu-left'=> esc_html__('Top Menu (left)', 'lsx'), |
|
51 | + 'social'=> esc_html__('Social Menu', 'lsx'), |
|
52 | + 'footer'=> esc_html__('Footer Menu', 'lsx') |
|
53 | + )); |
|
54 | 54 | |
55 | 55 | //Set the content width |
56 | 56 | $content_width = 1140; |
57 | 57 | |
58 | - add_editor_style( get_template_directory_uri() . '/css/editor-style.css' ); |
|
59 | - add_theme_support( 'html5', array( 'caption' ) ); |
|
58 | + add_editor_style(get_template_directory_uri() . '/css/editor-style.css'); |
|
59 | + add_theme_support('html5', array('caption')); |
|
60 | 60 | |
61 | - add_theme_support( 'woocommerce' ); |
|
62 | - add_theme_support( 'sensei' ); |
|
61 | + add_theme_support('woocommerce'); |
|
62 | + add_theme_support('sensei'); |
|
63 | 63 | |
64 | - add_theme_support( 'starter-content', array( |
|
64 | + add_theme_support('starter-content', array( |
|
65 | 65 | 'widgets' => array( |
66 | 66 | 'sidebar-home' => array( |
67 | 67 | 'custom_widget_1' => array( |
68 | 68 | 'text', |
69 | 69 | array( |
70 | 70 | 'title' => '', |
71 | - 'text' => wp_kses_post( '<div class="lsx-full-width"><div class="row"><div class="col-sm-6"><h3>Full Width Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros.</p><p><a href="#" class="btn cta-btn">Lorem ipsum</a></p></div><div class="col-sm-6"><h3>Full Width Widget</h3><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros.</p></div></div></div>' ), |
|
71 | + 'text' => wp_kses_post('<div class="lsx-full-width"><div class="row"><div class="col-sm-6"><h3>Full Width Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros.</p><p><a href="#" class="btn cta-btn">Lorem ipsum</a></p></div><div class="col-sm-6"><h3>Full Width Widget</h3><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros.</p></div></div></div>'), |
|
72 | 72 | ) |
73 | 73 | ), |
74 | 74 | 'custom_widget_2' => array( |
75 | 75 | 'text', |
76 | 76 | array( |
77 | 77 | 'title' => '', |
78 | - 'text' => wp_kses_post( '<div class="row"><div class="col-sm-6"><h3 style="margin-top:0">Text Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros.</p></div><div class="col-sm-6"><h3 style="margin-top:0">Text Widget</h3><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque <a href="#">volutpat mattis eros</a>.</p></div></div>' ), |
|
78 | + 'text' => wp_kses_post('<div class="row"><div class="col-sm-6"><h3 style="margin-top:0">Text Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros.</p></div><div class="col-sm-6"><h3 style="margin-top:0">Text Widget</h3><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque <a href="#">volutpat mattis eros</a>.</p></div></div>'), |
|
79 | 79 | ) |
80 | 80 | ), |
81 | 81 | 'custom_widget_3' => array( |
82 | 82 | 'text', |
83 | 83 | array( |
84 | 84 | 'title' => '', |
85 | - 'text' => wp_kses_post( '<div class="lsx-full-width-alt"><div class="row"><div class="col-sm-6"><h3>Full Width CTA Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros.</p><p><a href="#" class="btn cta-btn">Lorem ipsum</a></p></div><div class="col-sm-6"><h3>Full Width CTA Widget</h3><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros.</p><p><a href="#" class="btn">Lorem ipsum</a></p></div></div></div>' ), |
|
85 | + 'text' => wp_kses_post('<div class="lsx-full-width-alt"><div class="row"><div class="col-sm-6"><h3>Full Width CTA Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros.</p><p><a href="#" class="btn cta-btn">Lorem ipsum</a></p></div><div class="col-sm-6"><h3>Full Width CTA Widget</h3><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros.</p><p><a href="#" class="btn">Lorem ipsum</a></p></div></div></div>'), |
|
86 | 86 | ) |
87 | 87 | ), |
88 | 88 | 'custom_widget_4' => array( |
89 | 89 | 'text', |
90 | 90 | array( |
91 | 91 | 'title' => '', |
92 | - 'text' => wp_kses_post( '<div class="row"><div class="col-sm-12"><h3 style="margin-top:0">Text Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.</p></div></div>' ), |
|
92 | + 'text' => wp_kses_post('<div class="row"><div class="col-sm-12"><h3 style="margin-top:0">Text Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.</p></div></div>'), |
|
93 | 93 | ) |
94 | 94 | ), |
95 | 95 | ), |
@@ -98,22 +98,22 @@ discard block |
||
98 | 98 | 'custom_widget_1' => array( |
99 | 99 | 'text', |
100 | 100 | array( |
101 | - 'title' => esc_html__( 'Footer Widget', 'lsx' ), |
|
102 | - 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae ipsum nec sapien consectetur convallis eu sit amet diam. Praesent dignissim vel arcu et gravida.', 'lsx' ), |
|
101 | + 'title' => esc_html__('Footer Widget', 'lsx'), |
|
102 | + 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae ipsum nec sapien consectetur convallis eu sit amet diam. Praesent dignissim vel arcu et gravida.', 'lsx'), |
|
103 | 103 | ) |
104 | 104 | ), |
105 | 105 | 'custom_widget_2' => array( |
106 | 106 | 'text', |
107 | 107 | array( |
108 | - 'title' => esc_html__( 'Footer Widget', 'lsx' ), |
|
109 | - 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae ipsum nec sapien consectetur convallis eu sit amet diam. Praesent dignissim vel arcu et gravida.', 'lsx' ), |
|
108 | + 'title' => esc_html__('Footer Widget', 'lsx'), |
|
109 | + 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae ipsum nec sapien consectetur convallis eu sit amet diam. Praesent dignissim vel arcu et gravida.', 'lsx'), |
|
110 | 110 | ) |
111 | 111 | ), |
112 | 112 | 'custom_widget_3' => array( |
113 | 113 | 'text', |
114 | 114 | array( |
115 | - 'title' => esc_html__( 'Footer Widget', 'lsx' ), |
|
116 | - 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae ipsum nec sapien consectetur convallis eu sit amet diam. Praesent dignissim vel arcu et gravida.', 'lsx' ), |
|
115 | + 'title' => esc_html__('Footer Widget', 'lsx'), |
|
116 | + 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae ipsum nec sapien consectetur convallis eu sit amet diam. Praesent dignissim vel arcu et gravida.', 'lsx'), |
|
117 | 117 | ) |
118 | 118 | ), |
119 | 119 | ), |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | 'custom_widget_1' => array( |
123 | 123 | 'text', |
124 | 124 | array( |
125 | - 'title' => esc_html__( 'Footer Call to Action Widget', 'lsx' ), |
|
126 | - 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.', 'lsx' ), |
|
125 | + 'title' => esc_html__('Footer Call to Action Widget', 'lsx'), |
|
126 | + 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.', 'lsx'), |
|
127 | 127 | ) |
128 | 128 | ), |
129 | 129 | ), |
@@ -149,15 +149,15 @@ discard block |
||
149 | 149 | |
150 | 150 | 'attachments' => array( |
151 | 151 | 'image-banner-placeholder-01' => array( |
152 | - 'post_title' => esc_html_x( 'Banner Placeholder 01', 'Theme starter content', 'lsx' ), |
|
152 | + 'post_title' => esc_html_x('Banner Placeholder 01', 'Theme starter content', 'lsx'), |
|
153 | 153 | 'file' => 'img/banner-placeholder-01.jpg', |
154 | 154 | ), |
155 | 155 | 'image-banner-placeholder-02' => array( |
156 | - 'post_title' => esc_html_x( 'Banner Placeholder 02', 'Theme starter content', 'lsx' ), |
|
156 | + 'post_title' => esc_html_x('Banner Placeholder 02', 'Theme starter content', 'lsx'), |
|
157 | 157 | 'file' => 'img/banner-placeholder-02.jpg', |
158 | 158 | ), |
159 | 159 | 'image-banner-placeholder-03' => array( |
160 | - 'post_title' => esc_html_x( 'Banner Placeholder 03', 'Theme starter content', 'lsx' ), |
|
160 | + 'post_title' => esc_html_x('Banner Placeholder 03', 'Theme starter content', 'lsx'), |
|
161 | 161 | 'file' => 'img/banner-placeholder-03.jpg', |
162 | 162 | ), |
163 | 163 | ), |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | 'nav_menus' => array( |
172 | 172 | 'primary' => array( |
173 | - 'name' => esc_html__( 'Primary Menu', 'lsx' ), |
|
173 | + 'name' => esc_html__('Primary Menu', 'lsx'), |
|
174 | 174 | 'items' => array( |
175 | 175 | 'page_home', |
176 | 176 | 'page_about', |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | ), |
180 | 180 | ), |
181 | 181 | 'top-menu' => array( |
182 | - 'name' => esc_html__( 'Top Menu', 'lsx' ), |
|
182 | + 'name' => esc_html__('Top Menu', 'lsx'), |
|
183 | 183 | 'items' => array( |
184 | 184 | 'custom_link_1' => array( |
185 | 185 | 'title' => 'View Map', |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | ), |
203 | 203 | ), |
204 | 204 | 'social' => array( |
205 | - 'name' => esc_html__( 'Social Menu', 'lsx' ), |
|
205 | + 'name' => esc_html__('Social Menu', 'lsx'), |
|
206 | 206 | 'items' => array( |
207 | 207 | 'link_facebook', |
208 | 208 | 'link_foursquare', |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | ), |
216 | 216 | ), |
217 | 217 | 'footer' => array( |
218 | - 'name' => esc_html__( 'Footer Menu', 'lsx' ), |
|
218 | + 'name' => esc_html__('Footer Menu', 'lsx'), |
|
219 | 219 | 'items' => array( |
220 | 220 | 'page_about', |
221 | 221 | 'page_contact', |
@@ -228,21 +228,21 @@ discard block |
||
228 | 228 | 'lsx_header_search' => '1', |
229 | 229 | 'lsx_layout' => '1c', |
230 | 230 | ), |
231 | - ) ); |
|
231 | + )); |
|
232 | 232 | } |
233 | 233 | endif; // lsx_setup |
234 | -add_action( 'after_setup_theme', 'lsx_setup' ); |
|
234 | +add_action('after_setup_theme', 'lsx_setup'); |
|
235 | 235 | |
236 | 236 | /** |
237 | 237 | * Removes the "Custom Fields" meta box. |
238 | 238 | */ |
239 | 239 | function lsx_remove_meta_boxes() { |
240 | 240 | $post_types = get_post_types(); |
241 | - foreach($post_types as $post_type){ |
|
242 | - remove_meta_box( 'postcustom' , $post_type , 'normal' ); |
|
241 | + foreach ($post_types as $post_type) { |
|
242 | + remove_meta_box('postcustom', $post_type, 'normal'); |
|
243 | 243 | } |
244 | 244 | } |
245 | -add_action( 'admin_menu' , 'lsx_remove_meta_boxes' ); |
|
245 | +add_action('admin_menu', 'lsx_remove_meta_boxes'); |
|
246 | 246 | |
247 | 247 | /** |
248 | 248 | * Overwrite the $content_width var, based on the layout of the page. |
@@ -254,33 +254,33 @@ discard block |
||
254 | 254 | function lsx_process_content_width() { |
255 | 255 | global $content_width; |
256 | 256 | |
257 | - if( |
|
257 | + if ( |
|
258 | 258 | is_page_template('page-templates/template-portfolio.php') || |
259 | 259 | is_page_template('page-templates/template-front-page.php') || |
260 | 260 | is_page_template('page-templates/template-full-width.php') || |
261 | 261 | is_post_type_archive('jetpack-portfolio') || |
262 | - is_tax(array('jetpack-portfolio-type','jetpack-portfolio-tag')) || |
|
262 | + is_tax(array('jetpack-portfolio-type', 'jetpack-portfolio-tag')) || |
|
263 | 263 | is_singular('jetpack-portfolio') |
264 | - ){ |
|
264 | + ) { |
|
265 | 265 | $content_width = 1140; |
266 | 266 | } |
267 | 267 | } |
268 | -add_action('wp_head','lsx_process_content_width'); |
|
268 | +add_action('wp_head', 'lsx_process_content_width'); |
|
269 | 269 | |
270 | 270 | /** |
271 | 271 | * Disable the comments form by default for the page post type. |
272 | 272 | * @package lsx |
273 | 273 | * @subpackage config |
274 | 274 | */ |
275 | -function lsx_page_comments_off( $data ) { |
|
276 | - if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) { |
|
275 | +function lsx_page_comments_off($data) { |
|
276 | + if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) { |
|
277 | 277 | $data['comment_status'] = 0; |
278 | 278 | $data['ping_status'] = 0; |
279 | 279 | } |
280 | 280 | |
281 | 281 | return $data; |
282 | 282 | } |
283 | -add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' ); |
|
283 | +add_filter('wp_insert_post_data', 'lsx_page_comments_off'); |
|
284 | 284 | |
285 | 285 | /** |
286 | 286 | * Disable the comments form by default for the page post type. |
@@ -288,14 +288,14 @@ discard block |
||
288 | 288 | * @subpackage config |
289 | 289 | */ |
290 | 290 | function lsx_is_legacy($data) { |
291 | - if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) { |
|
291 | + if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) { |
|
292 | 292 | $data['comment_status'] = 0; |
293 | 293 | $data['ping_status'] = 0; |
294 | 294 | } |
295 | 295 | |
296 | 296 | return $data; |
297 | 297 | } |
298 | -add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' ); |
|
298 | +add_filter('wp_insert_post_data', 'lsx_page_comments_off'); |
|
299 | 299 | |
300 | 300 | /** |
301 | 301 | * Run the init command |
@@ -303,11 +303,11 @@ discard block |
||
303 | 303 | * @subpackage config |
304 | 304 | */ |
305 | 305 | function lsx_init() { |
306 | - if(class_exists('WooCommerce')){ |
|
307 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 ); |
|
306 | + if (class_exists('WooCommerce')) { |
|
307 | + remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0); |
|
308 | 308 | } |
309 | 309 | } |
310 | -add_action( 'init', 'lsx_init',100 ); |
|
310 | +add_action('init', 'lsx_init', 100); |
|
311 | 311 | |
312 | 312 | /** |
313 | 313 | * Run on the wp_head |
@@ -316,11 +316,11 @@ discard block |
||
316 | 316 | */ |
317 | 317 | function lsx_wp_head() { |
318 | 318 | |
319 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
320 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
319 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
320 | + $layout = apply_filters('lsx_layout', $layout); |
|
321 | 321 | |
322 | - if('1c' === $layout && (is_author() || is_search() || is_post_type_archive(array('post','page','jetpack-portfolio')) || is_tag() || is_category() || is_date() || is_tax()) ){ |
|
323 | - remove_action('lsx_content_top', 'lsx_breadcrumbs', 100 ); |
|
322 | + if ('1c' === $layout && (is_author() || is_search() || is_post_type_archive(array('post', 'page', 'jetpack-portfolio')) || is_tag() || is_category() || is_date() || is_tax())) { |
|
323 | + remove_action('lsx_content_top', 'lsx_breadcrumbs', 100); |
|
324 | 324 | } |
325 | 325 | } |
326 | -add_action( 'wp_head', 'lsx_wp_head',100 ); |
|
326 | +add_action('wp_head', 'lsx_wp_head', 100); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Enqueue scripts and styles. |
@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | |
13 | 13 | wp_enqueue_style('lsx_main_style', get_template_directory_uri() . '/style.css', array(), LSX_VERSION); |
14 | 14 | |
15 | - wp_enqueue_style('lsx_main', get_template_directory_uri() . '/css/app.css', array( 'lsx_main_style', 'fontawesome', 'medium-break' ), LSX_VERSION); |
|
15 | + wp_enqueue_style('lsx_main', get_template_directory_uri() . '/css/app.css', array('lsx_main_style', 'fontawesome', 'medium-break'), LSX_VERSION); |
|
16 | 16 | |
17 | - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { |
|
18 | - wp_enqueue_script( 'comment-reply' ); |
|
17 | + if (is_singular() && comments_open() && get_option('thread_comments')) { |
|
18 | + wp_enqueue_script('comment-reply'); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/vendor/bootstrap.min.js', array('jquery'), LSX_VERSION, false); |
@@ -26,31 +26,31 @@ discard block |
||
26 | 26 | wp_enqueue_script('picturefill', get_template_directory_uri() . '/js/vendor/picturefill.min.js', array(), LSX_VERSION, false); |
27 | 27 | |
28 | 28 | wp_enqueue_script('masonry'); |
29 | - wp_enqueue_script('imagesLoaded', get_template_directory_uri().'/js/vendor/imagesloaded.pkgd.min.js', array('jquery','masonry'), LSX_VERSION); |
|
30 | - if(defined('WP_DEBUG') && true === WP_DEBUG){ |
|
29 | + wp_enqueue_script('imagesLoaded', get_template_directory_uri() . '/js/vendor/imagesloaded.pkgd.min.js', array('jquery', 'masonry'), LSX_VERSION); |
|
30 | + if (defined('WP_DEBUG') && true === WP_DEBUG) { |
|
31 | 31 | wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.js', array('masonry'), LSX_VERSION, false); |
32 | - }else{ |
|
32 | + } else { |
|
33 | 33 | wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.min.js', array('masonry'), LSX_VERSION, false); |
34 | 34 | } |
35 | 35 | |
36 | 36 | //Set some parameters that we can use in the JS |
37 | 37 | $is_portfolio = false; |
38 | - if(is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag') || is_page_template('page-templates/template-portfolio.php')){ |
|
38 | + if (is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag') || is_page_template('page-templates/template-portfolio.php')) { |
|
39 | 39 | $is_portfolio = true; |
40 | 40 | } |
41 | 41 | $param_array = array( |
42 | 42 | 'is_portfolio' => $is_portfolio |
43 | 43 | ); |
44 | 44 | //Set the columns for the archives |
45 | - $param_array['columns'] = apply_filters('lsx_archive_column_number',3); |
|
46 | - wp_localize_script( 'lsx_script', 'lsx_params', $param_array ); |
|
45 | + $param_array['columns'] = apply_filters('lsx_archive_column_number', 3); |
|
46 | + wp_localize_script('lsx_script', 'lsx_params', $param_array); |
|
47 | 47 | |
48 | - wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), LSX_VERSION ); |
|
48 | + wp_enqueue_style('fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), LSX_VERSION); |
|
49 | 49 | |
50 | 50 | wp_enqueue_style('medium-break', get_template_directory_uri() . '/css/medium-nav-break.css', array(), LSX_VERSION); |
51 | 51 | |
52 | - $font = get_theme_mod('lsx_font','raleway_open_sans'); |
|
53 | - switch($font){ |
|
52 | + $font = get_theme_mod('lsx_font', 'raleway_open_sans'); |
|
53 | + switch ($font) { |
|
54 | 54 | case 'raleway_open_sans': |
55 | 55 | $header_font_location = 'Raleway'; |
56 | 56 | $body_font_location = 'Open+Sans'; |
@@ -79,18 +79,18 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | $http_var = 'http'; |
82 | - if(is_ssl()){ $http_var .= 's'; } |
|
82 | + if (is_ssl()) { $http_var .= 's'; } |
|
83 | 83 | |
84 | 84 | //Call the Google Fonts and then Enque them. |
85 | - wp_register_style('lsx-header-font', $http_var.'://fonts.googleapis.com/css?family='.$header_font_location); |
|
86 | - wp_register_style('lsx-body-font', $http_var.'://fonts.googleapis.com/css?family='.$body_font_location); |
|
87 | - wp_enqueue_style( 'lsx-header-font' ); |
|
88 | - wp_enqueue_style( 'lsx-body-font' ); |
|
85 | + wp_register_style('lsx-header-font', $http_var . '://fonts.googleapis.com/css?family=' . $header_font_location); |
|
86 | + wp_register_style('lsx-body-font', $http_var . '://fonts.googleapis.com/css?family=' . $body_font_location); |
|
87 | + wp_enqueue_style('lsx-header-font'); |
|
88 | + wp_enqueue_style('lsx-body-font'); |
|
89 | 89 | |
90 | - wp_enqueue_style('lsx_font_scheme', esc_url( get_template_directory_uri() . '/css/'.$font.'.css' ), array(), LSX_VERSION); |
|
90 | + wp_enqueue_style('lsx_font_scheme', esc_url(get_template_directory_uri() . '/css/' . $font . '.css'), array(), LSX_VERSION); |
|
91 | 91 | |
92 | 92 | } |
93 | -add_action( 'wp_enqueue_scripts', 'lsx_scripts' ); |
|
93 | +add_action('wp_enqueue_scripts', 'lsx_scripts'); |
|
94 | 94 | |
95 | 95 | /** |
96 | 96 | * Enqueue scripts and styles (for child theme). |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | */ |
101 | 101 | function lsx_scripts_child_theme() { |
102 | 102 | global $content_width; |
103 | - if(is_child_theme() && file_exists(get_stylesheet_directory() . '/custom.css')) { |
|
104 | - wp_enqueue_style( 'child-css', get_stylesheet_directory_uri() . '/custom.css', array( 'lsx_main' ), LSX_VERSION ); |
|
103 | + if (is_child_theme() && file_exists(get_stylesheet_directory() . '/custom.css')) { |
|
104 | + wp_enqueue_style('child-css', get_stylesheet_directory_uri() . '/custom.css', array('lsx_main'), LSX_VERSION); |
|
105 | 105 | } |
106 | 106 | } |
107 | -add_action( 'wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999 ); |
|
107 | +add_action('wp_enqueue_scripts', 'lsx_scripts_child_theme', 1999); |
|
108 | 108 | |
109 | 109 | /** |
110 | 110 | * Defer JavaScript |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | * @package lsx |
113 | 113 | * @subpackage scripts |
114 | 114 | */ |
115 | -function lsx_scripts_defer_parsing( $url ) { |
|
116 | - if ( ! ( is_admin() ) ) { |
|
117 | - if ( FALSE === strpos( $url, '.js' ) ) return $url; |
|
118 | - if ( strpos( $url, 'jquery.js' ) ) return $url; |
|
119 | - if ( strpos( $url, ' defer ' ) ) return $url; |
|
115 | +function lsx_scripts_defer_parsing($url) { |
|
116 | + if ( ! (is_admin())) { |
|
117 | + if (FALSE === strpos($url, '.js')) return $url; |
|
118 | + if (strpos($url, 'jquery.js')) return $url; |
|
119 | + if (strpos($url, ' defer ')) return $url; |
|
120 | 120 | return "$url' defer onload='"; |
121 | 121 | } |
122 | 122 | |
123 | 123 | return $url; |
124 | 124 | } |
125 | -add_filter( 'clean_url', 'lsx_scripts_defer_parsing', 11, 1 ); |
|
125 | +add_filter('clean_url', 'lsx_scripts_defer_parsing', 11, 1); |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | * $lsx_supports[] = 'body'; |
25 | 25 | */ |
26 | 26 | function lsx_body_top() { |
27 | - do_action( 'lsx_body_top' ); |
|
27 | + do_action('lsx_body_top'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | function lsx_body_bottom() { |
31 | - do_action( 'lsx_body_bottom' ); |
|
31 | + do_action('lsx_body_bottom'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | * $lsx_supports[] = 'head'; |
38 | 38 | */ |
39 | 39 | function lsx_head_top() { |
40 | - do_action( 'lsx_head_top' ); |
|
40 | + do_action('lsx_head_top'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | function lsx_head_bottom() { |
44 | - do_action( 'lsx_head_bottom' ); |
|
44 | + do_action('lsx_head_bottom'); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -50,27 +50,27 @@ discard block |
||
50 | 50 | * $lsx_supports[] = 'header'; |
51 | 51 | */ |
52 | 52 | function lsx_header_before() { |
53 | - do_action( 'lsx_header_before' ); |
|
53 | + do_action('lsx_header_before'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | function lsx_header_after() { |
57 | - do_action( 'lsx_header_after' ); |
|
57 | + do_action('lsx_header_after'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | function lsx_header_top() { |
61 | - do_action( 'lsx_header_top' ); |
|
61 | + do_action('lsx_header_top'); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | function lsx_header_bottom() { |
65 | - do_action( 'lsx_header_bottom' ); |
|
65 | + do_action('lsx_header_bottom'); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | function lsx_nav_before() { |
69 | - do_action( 'lsx_nav_before' ); |
|
69 | + do_action('lsx_nav_before'); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | function lsx_nav_after() { |
73 | - do_action( 'lsx_nav_after' ); |
|
73 | + do_action('lsx_nav_after'); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | |
82 | 82 | function lsx_banner_content() { |
83 | - do_action( 'lsx_banner_content' ); |
|
83 | + do_action('lsx_banner_content'); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -89,39 +89,39 @@ discard block |
||
89 | 89 | * $lsx_supports[] = 'content'; |
90 | 90 | */ |
91 | 91 | function lsx_content_wrap_before() { |
92 | - do_action( 'lsx_content_wrap_before' ); |
|
92 | + do_action('lsx_content_wrap_before'); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | function lsx_content_wrap_after() { |
96 | - do_action( 'lsx_content_wrap_after' ); |
|
96 | + do_action('lsx_content_wrap_after'); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | function lsx_content_before() { |
100 | - do_action( 'lsx_content_before' ); |
|
100 | + do_action('lsx_content_before'); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | function lsx_content_after() { |
104 | - do_action( 'lsx_content_after' ); |
|
104 | + do_action('lsx_content_after'); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | function lsx_content_top() { |
108 | - do_action( 'lsx_content_top' ); |
|
108 | + do_action('lsx_content_top'); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | function lsx_content_bottom() { |
112 | - do_action( 'lsx_content_bottom' ); |
|
112 | + do_action('lsx_content_bottom'); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | function lsx_content_post_meta() { |
116 | - do_action( 'lsx_content_post_meta' ); |
|
116 | + do_action('lsx_content_post_meta'); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | function lsx_content_post_tags() { |
120 | - do_action( 'lsx_content_post_tags' ); |
|
120 | + do_action('lsx_content_post_tags'); |
|
121 | 121 | } |
122 | 122 | |
123 | -function lsx_content_sharing(){ |
|
124 | - do_action( 'lsx_content_sharing' ); |
|
123 | +function lsx_content_sharing() { |
|
124 | + do_action('lsx_content_sharing'); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -130,19 +130,19 @@ discard block |
||
130 | 130 | * $lsx_supports[] = 'entry'; |
131 | 131 | */ |
132 | 132 | function lsx_entry_before() { |
133 | - do_action( 'lsx_entry_before' ); |
|
133 | + do_action('lsx_entry_before'); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | function lsx_entry_after() { |
137 | - do_action( 'lsx_entry_after' ); |
|
137 | + do_action('lsx_entry_after'); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | function lsx_entry_top() { |
141 | - do_action( 'lsx_entry_top' ); |
|
141 | + do_action('lsx_entry_top'); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | function lsx_entry_bottom() { |
145 | - do_action( 'lsx_entry_bottom' ); |
|
145 | + do_action('lsx_entry_bottom'); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -151,11 +151,11 @@ discard block |
||
151 | 151 | * $lsx_supports[] = 'comments'; |
152 | 152 | */ |
153 | 153 | function lsx_comments_before() { |
154 | - do_action( 'lsx_comments_before' ); |
|
154 | + do_action('lsx_comments_before'); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | function lsx_comments_after() { |
158 | - do_action( 'lsx_comments_after' ); |
|
158 | + do_action('lsx_comments_after'); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -164,19 +164,19 @@ discard block |
||
164 | 164 | * $lsx_supports[] = 'sidebar'; |
165 | 165 | */ |
166 | 166 | function lsx_sidebars_before() { |
167 | - do_action( 'lsx_sidebars_before' ); |
|
167 | + do_action('lsx_sidebars_before'); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | function lsx_sidebars_after() { |
171 | - do_action( 'lsx_sidebars_after' ); |
|
171 | + do_action('lsx_sidebars_after'); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | function lsx_sidebar_top() { |
175 | - do_action( 'lsx_sidebar_top' ); |
|
175 | + do_action('lsx_sidebar_top'); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | function lsx_sidebar_bottom() { |
179 | - do_action( 'lsx_sidebar_bottom' ); |
|
179 | + do_action('lsx_sidebar_bottom'); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -185,17 +185,17 @@ discard block |
||
185 | 185 | * $lsx_supports[] = 'footer'; |
186 | 186 | */ |
187 | 187 | function lsx_footer_before() { |
188 | - do_action( 'lsx_footer_before' ); |
|
188 | + do_action('lsx_footer_before'); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | function lsx_footer_after() { |
192 | - do_action( 'lsx_footer_after' ); |
|
192 | + do_action('lsx_footer_after'); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | function lsx_footer_top() { |
196 | - do_action( 'lsx_footer_top' ); |
|
196 | + do_action('lsx_footer_top'); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | function lsx_footer_bottom() { |
200 | - do_action( 'lsx_footer_bottom' ); |
|
200 | + do_action('lsx_footer_bottom'); |
|
201 | 201 | } |
202 | 202 | \ No newline at end of file |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * |
5 | 5 | * @package lsx |
6 | 6 | */ |
7 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
7 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
8 | 8 | |
9 | 9 | define('LSX_VERSION', '1.8.7'); |
10 | 10 | |
@@ -19,22 +19,22 @@ discard block |
||
19 | 19 | require get_template_directory() . '/inc/comment-walker.php'; |
20 | 20 | require get_template_directory() . '/inc/jetpack.php'; |
21 | 21 | require get_template_directory() . '/inc/lazyload.php'; |
22 | -if(class_exists('BuddyPress')){ |
|
22 | +if (class_exists('BuddyPress')) { |
|
23 | 23 | require get_template_directory() . '/inc/buddypress.php'; |
24 | 24 | } |
25 | -if(class_exists('WooCommerce')){ |
|
25 | +if (class_exists('WooCommerce')) { |
|
26 | 26 | require get_template_directory() . '/inc/woocommerce.php'; |
27 | 27 | } |
28 | -if(class_exists('WP_Job_Manager')){ |
|
28 | +if (class_exists('WP_Job_Manager')) { |
|
29 | 29 | require get_template_directory() . '/inc/wp-job-manager.php'; |
30 | 30 | } |
31 | -if(class_exists('Tribe__Events__Main')){ |
|
31 | +if (class_exists('Tribe__Events__Main')) { |
|
32 | 32 | require get_template_directory() . '/inc/the-events-calendar.php'; |
33 | 33 | } |
34 | 34 | require get_template_directory() . '/inc/template-tags.php'; |
35 | 35 | require get_template_directory() . '/inc/extras.php'; |
36 | 36 | require get_template_directory() . '/inc/wp-bootstrap-navwalker.php'; |
37 | -if(class_exists('Sensei_WC')){ |
|
37 | +if (class_exists('Sensei_WC')) { |
|
38 | 38 | require get_template_directory() . '/inc/sensei.php'; |
39 | 39 | } |
40 | 40 | require get_template_directory() . '/inc/welcome.php'; |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | * @category customizer |
48 | 48 | * @return $lsx_controls array() |
49 | 49 | */ |
50 | -function lsx_customizer_core_controls( $lsx_controls ) { |
|
50 | +function lsx_customizer_core_controls($lsx_controls) { |
|
51 | 51 | $lsx_controls['sections']['lsx-core'] = array( |
52 | - 'title' => esc_html__( 'Core Settings', 'lsx' ), |
|
53 | - 'description' => esc_html__( 'Change the core settings.', 'lsx' ), |
|
52 | + 'title' => esc_html__('Core Settings', 'lsx'), |
|
53 | + 'description' => esc_html__('Change the core settings.', 'lsx'), |
|
54 | 54 | 'priority' => 21 |
55 | 55 | ); |
56 | 56 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | ); |
62 | 62 | |
63 | 63 | $lsx_controls['fields']['lsx_lazyload_status'] = array( |
64 | - 'label' => esc_html__( 'Lazy Loading Images', 'lsx' ), |
|
64 | + 'label' => esc_html__('Lazy Loading Images', 'lsx'), |
|
65 | 65 | 'section' => 'lsx-core', |
66 | 66 | 'type' => 'checkbox', |
67 | 67 | ); |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | ); |
74 | 74 | |
75 | 75 | $lsx_controls['fields']['lsx_preloader_content_status'] = array( |
76 | - 'label' => esc_html__( 'Preloader Content', 'lsx' ), |
|
76 | + 'label' => esc_html__('Preloader Content', 'lsx'), |
|
77 | 77 | 'section' => 'lsx-core', |
78 | 78 | 'type' => 'checkbox', |
79 | 79 | ); |
80 | 80 | |
81 | 81 | return $lsx_controls; |
82 | 82 | } |
83 | -add_filter( 'lsx_customizer_controls', 'lsx_customizer_core_controls' ); |
|
83 | +add_filter('lsx_customizer_controls', 'lsx_customizer_core_controls'); |
|
84 | 84 | |
85 | 85 | /** |
86 | 86 | * Returns an array of the layout panel. |
@@ -91,56 +91,56 @@ discard block |
||
91 | 91 | * @return $lsx_controls array() |
92 | 92 | */ |
93 | 93 | function lsx_customizer_layout_controls($lsx_controls) { |
94 | - $lsx_controls['settings']['lsx_header_layout'] = array( |
|
94 | + $lsx_controls['settings']['lsx_header_layout'] = array( |
|
95 | 95 | 'default' => 'inline', //Default setting/value to save |
96 | 96 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
97 | 97 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
98 | 98 | ); |
99 | 99 | $lsx_controls['fields']['lsx_header_layout'] = array( |
100 | - 'label' => esc_html__('Header','lsx'), |
|
100 | + 'label' => esc_html__('Header', 'lsx'), |
|
101 | 101 | 'section' => 'lsx-layout', |
102 | 102 | 'control' => 'LSX_Customize_Header_Layout_Control', |
103 | - 'choices' => array('central','expanded','inline') |
|
103 | + 'choices' => array('central', 'expanded', 'inline') |
|
104 | 104 | ); |
105 | 105 | $lsx_controls['sections']['lsx-layout'] = array( |
106 | - 'title' => esc_html__( 'Layout', 'lsx' ), |
|
107 | - 'description' => esc_html__( 'Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx' ), |
|
106 | + 'title' => esc_html__('Layout', 'lsx'), |
|
107 | + 'description' => esc_html__('Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx'), |
|
108 | 108 | 'priority' => 22 |
109 | 109 | ); |
110 | - $lsx_controls['settings']['lsx_layout'] = array( |
|
110 | + $lsx_controls['settings']['lsx_layout'] = array( |
|
111 | 111 | 'default' => '2cr', //Default setting/value to save |
112 | 112 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
113 | 113 | 'transport' => 'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
114 | 114 | ); |
115 | - $lsx_controls['settings']['lsx_header_fixed'] = array( |
|
115 | + $lsx_controls['settings']['lsx_header_fixed'] = array( |
|
116 | 116 | 'default' => false, //Default setting/value to save |
117 | 117 | 'sanitize_callback' => 'lsx_sanitize_checkbox', |
118 | 118 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
119 | 119 | ); |
120 | 120 | $lsx_controls['fields']['lsx_header_fixed'] = array( |
121 | - 'label' => esc_html__('Fixed Header','lsx'), |
|
121 | + 'label' => esc_html__('Fixed Header', 'lsx'), |
|
122 | 122 | 'section' => 'lsx-layout', |
123 | 123 | 'type' => 'checkbox', |
124 | 124 | ); |
125 | - $lsx_controls['settings']['lsx_header_search'] = array( |
|
125 | + $lsx_controls['settings']['lsx_header_search'] = array( |
|
126 | 126 | 'default' => false, //Default setting/value to save |
127 | 127 | 'sanitize_callback' => 'lsx_sanitize_checkbox', |
128 | 128 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
129 | 129 | ); |
130 | 130 | $lsx_controls['fields']['lsx_header_search'] = array( |
131 | - 'label' => esc_html__('Search Box in Header','lsx'), |
|
131 | + 'label' => esc_html__('Search Box in Header', 'lsx'), |
|
132 | 132 | 'section' => 'lsx-layout', |
133 | 133 | 'type' => 'checkbox', |
134 | 134 | ); |
135 | 135 | $lsx_controls['fields']['lsx_layout'] = array( |
136 | - 'label' => esc_html__('Body','lsx'), |
|
136 | + 'label' => esc_html__('Body', 'lsx'), |
|
137 | 137 | 'section' => 'lsx-layout', |
138 | 138 | 'control' => 'LSX_Customize_Layout_Control', |
139 | - 'choices' => array('1c','2cr','2cl') |
|
139 | + 'choices' => array('1c', '2cr', '2cl') |
|
140 | 140 | ); |
141 | 141 | return $lsx_controls; |
142 | 142 | } |
143 | -add_filter('lsx_customizer_controls','lsx_customizer_layout_controls'); |
|
143 | +add_filter('lsx_customizer_controls', 'lsx_customizer_layout_controls'); |
|
144 | 144 | |
145 | 145 | /** |
146 | 146 | * Returns an array of the font controls. |
@@ -152,11 +152,11 @@ discard block |
||
152 | 152 | */ |
153 | 153 | function lsx_customizer_font_controls($lsx_controls) { |
154 | 154 | $lsx_controls['sections']['lsx-font'] = array( |
155 | - 'title' => esc_html__( 'Font', 'lsx' ), |
|
155 | + 'title' => esc_html__('Font', 'lsx'), |
|
156 | 156 | 'description' => 'Change the fonts sitewide.', |
157 | 157 | 'priority' => 41 |
158 | 158 | ); |
159 | - $lsx_controls['settings']['lsx_font'] = array( |
|
159 | + $lsx_controls['settings']['lsx_font'] = array( |
|
160 | 160 | 'default' => 'raleway_open_sans', //Default setting/value to save |
161 | 161 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
162 | 162 | 'transport' => 'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
@@ -170,13 +170,13 @@ discard block |
||
170 | 170 | 'choices' => array( |
171 | 171 | 'raleway_open_sans' => array( |
172 | 172 | 'header' => array( |
173 | - "title" => esc_html__( 'Raleway', 'lsx' ), |
|
173 | + "title" => esc_html__('Raleway', 'lsx'), |
|
174 | 174 | "location" => "Raleway", |
175 | 175 | "cssDeclaration" => "'Raleway', sans-serif", |
176 | 176 | "cssClass" => "raleway", |
177 | 177 | ), |
178 | 178 | 'body' => array( |
179 | - "title" => esc_html__( 'Open Sans', 'lsx' ), |
|
179 | + "title" => esc_html__('Open Sans', 'lsx'), |
|
180 | 180 | "location" => "Open+Sans", |
181 | 181 | "cssDeclaration" => "'Open Sans', sans-serif", |
182 | 182 | "cssClass" => "openSans" |
@@ -184,13 +184,13 @@ discard block |
||
184 | 184 | ), |
185 | 185 | 'noto_serif_noto_sans' => array( |
186 | 186 | 'header' => array( |
187 | - "title" => esc_html__( 'Noto Serif', 'lsx' ), |
|
187 | + "title" => esc_html__('Noto Serif', 'lsx'), |
|
188 | 188 | "location" => "Noto+Serif", |
189 | 189 | "cssDeclaration" => "'Noto Serif', serif", |
190 | 190 | "cssClass" => "notoSerif", |
191 | 191 | ), |
192 | 192 | 'body' => array( |
193 | - "title" => esc_html__( 'Noto Sans', 'lsx' ), |
|
193 | + "title" => esc_html__('Noto Sans', 'lsx'), |
|
194 | 194 | "location" => "Noto+Sans", |
195 | 195 | "cssDeclaration" => "'Noto Sans', sans-serif", |
196 | 196 | "cssClass" => "notoSans", |
@@ -198,13 +198,13 @@ discard block |
||
198 | 198 | ), |
199 | 199 | 'noto_sans_noto_sans' => array( |
200 | 200 | 'header' => array( |
201 | - "title" => esc_html__( 'Noto Sans', 'lsx' ), |
|
201 | + "title" => esc_html__('Noto Sans', 'lsx'), |
|
202 | 202 | "location" => "Noto+Sans", |
203 | 203 | "cssDeclaration" => "'Noto Sans', sans-serif", |
204 | 204 | "cssClass" => "notoSans", |
205 | 205 | ), |
206 | 206 | 'body' => array( |
207 | - "title" => esc_html__( 'Noto Sans', 'lsx' ), |
|
207 | + "title" => esc_html__('Noto Sans', 'lsx'), |
|
208 | 208 | "location" => "Noto+Sans", |
209 | 209 | "cssDeclaration" => "'Noto Sans', sans-serif", |
210 | 210 | "cssClass" => "notoSans", |
@@ -212,13 +212,13 @@ discard block |
||
212 | 212 | ), |
213 | 213 | 'alegreya_open_sans' => array( |
214 | 214 | 'header' => array( |
215 | - "title" => esc_html__( 'Alegreya', 'lsx' ), |
|
215 | + "title" => esc_html__('Alegreya', 'lsx'), |
|
216 | 216 | "location" => "Alegreya", |
217 | 217 | "cssDeclaration" => "'Alegreya', serif", |
218 | 218 | "cssClass" => "alegreya", |
219 | 219 | ), |
220 | 220 | 'body' => array( |
221 | - "title" => esc_html__( 'Open Sans', 'lsx' ), |
|
221 | + "title" => esc_html__('Open Sans', 'lsx'), |
|
222 | 222 | "location" => "Open+Sans", |
223 | 223 | "cssDeclaration" => "'Open Sans', sans-serif", |
224 | 224 | "cssClass" => "openSans" |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | ); |
230 | 230 | return $lsx_controls; |
231 | 231 | } |
232 | -add_filter('lsx_customizer_controls','lsx_customizer_font_controls'); |
|
232 | +add_filter('lsx_customizer_controls', 'lsx_customizer_font_controls'); |
|
233 | 233 | |
234 | 234 | /** |
235 | 235 | * Returns an array of $controls for the customizer class to generate. |
@@ -239,12 +239,12 @@ discard block |
||
239 | 239 | * @category customizer |
240 | 240 | * @return $lsx_controls array() |
241 | 241 | */ |
242 | -function lsx_get_customizer_controls(){ |
|
242 | +function lsx_get_customizer_controls() { |
|
243 | 243 | $lsx_controls = array(); |
244 | 244 | $lsx_controls = apply_filters('lsx_customizer_controls', $lsx_controls); |
245 | 245 | return $lsx_controls; |
246 | 246 | } |
247 | -$lsx_customizer = new LSX_Theme_Customizer( lsx_get_customizer_controls() ); |
|
247 | +$lsx_customizer = new LSX_Theme_Customizer(lsx_get_customizer_controls()); |
|
248 | 248 | |
249 | -add_image_size( 'lsx-thumbnail-wide', 350, 230, true ); |
|
250 | -add_image_size( 'lsx-thumbnail-single', 750, 350, true ); |
|
251 | 249 | \ No newline at end of file |
250 | +add_image_size('lsx-thumbnail-wide', 350, 230, true); |
|
251 | +add_image_size('lsx-thumbnail-single', 750, 350, true); |
|
252 | 252 | \ No newline at end of file |
@@ -12,20 +12,20 @@ discard block |
||
12 | 12 | |
13 | 13 | <?php |
14 | 14 | $format = get_post_format(); |
15 | - if ( false === $format ) { |
|
15 | + if (false === $format) { |
|
16 | 16 | $format = 'standard'; |
17 | 17 | } |
18 | 18 | $format_link = get_post_format_link($format); |
19 | 19 | $format = lsx_translate_format_to_fontawesome($format); |
20 | 20 | ?> |
21 | 21 | |
22 | - <?php if ( ! is_single() ) { ?> |
|
22 | + <?php if ( ! is_single()) { ?> |
|
23 | 23 | <header class="entry-header"> |
24 | 24 | <h1 class="entry-title"> |
25 | - <?php if ( has_post_thumbnail() ) { ?> |
|
26 | - <a href="<?php echo esc_url($format_link) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
25 | + <?php if (has_post_thumbnail()) { ?> |
|
26 | + <a href="<?php echo esc_url($format_link) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr($format) ?>"></a> |
|
27 | 27 | <?php } else { ?> |
28 | - <a href="<?php echo esc_url($format_link) ?>" class="format-link fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
28 | + <a href="<?php echo esc_url($format_link) ?>" class="format-link fa fa-<?php echo esc_attr($format) ?>"></a> |
|
29 | 29 | <?php } ?> |
30 | 30 | |
31 | 31 | <span><?php the_title(); ?></span> |
@@ -39,36 +39,36 @@ discard block |
||
39 | 39 | |
40 | 40 | <div class="entry-content"> |
41 | 41 | <?php |
42 | - if ( ! is_singular() ) { |
|
42 | + if ( ! is_singular()) { |
|
43 | 43 | the_excerpt(); |
44 | 44 | } else { |
45 | 45 | the_content(); |
46 | 46 | |
47 | - wp_link_pages( array( |
|
47 | + wp_link_pages(array( |
|
48 | 48 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
49 | 49 | 'after' => '</div></div>', |
50 | 50 | 'link_before' => '<span>', |
51 | 51 | 'link_after' => '</span>' |
52 | - ) ); |
|
52 | + )); |
|
53 | 53 | } ?> |
54 | 54 | </div><!-- .entry-content --> |
55 | 55 | |
56 | 56 | <footer class="footer-meta"> |
57 | - <?php if ( has_tag() || class_exists( 'LSX_Sharing' ) || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) : ?> |
|
57 | + <?php if (has_tag() || class_exists('LSX_Sharing') || (function_exists('sharing_display') || class_exists('Jetpack_Likes'))) : ?> |
|
58 | 58 | <div class="post-tags-wrapper"> |
59 | 59 | <?php lsx_content_post_tags(); ?> |
60 | 60 | |
61 | 61 | <?php |
62 | - if ( class_exists( 'LSX_Sharing' ) ) { |
|
62 | + if (class_exists('LSX_Sharing')) { |
|
63 | 63 | lsx_content_sharing(); |
64 | 64 | } else { |
65 | - if ( function_exists( 'sharing_display' ) ) { |
|
66 | - sharing_display( '', true ); |
|
65 | + if (function_exists('sharing_display')) { |
|
66 | + sharing_display('', true); |
|
67 | 67 | } |
68 | 68 | |
69 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
69 | + if (class_exists('Jetpack_Likes')) { |
|
70 | 70 | $custom_likes = new Jetpack_Likes; |
71 | - echo wp_kses_post( $custom_likes->post_likes( '' ) ); |
|
71 | + echo wp_kses_post($custom_likes->post_likes('')); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | ?> |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | |
78 | 78 | <?php |
79 | 79 | // If comments are open or we have at least one comment, load up the comment template |
80 | - if ( comments_open() || '0' != get_comments_number() ) : ?> |
|
81 | - <a class="comments-link post-meta-link" data-toggle="collapse" href="#comments-collapse"><strong><?php echo esc_html( get_comments_number() ) ?></strong> <?php esc_html_e('Comments','lsx'); ?> <span class="fa fa-chevron-down"></span></a> |
|
80 | + if (comments_open() || '0' != get_comments_number()) : ?> |
|
81 | + <a class="comments-link post-meta-link" data-toggle="collapse" href="#comments-collapse"><strong><?php echo esc_html(get_comments_number()) ?></strong> <?php esc_html_e('Comments', 'lsx'); ?> <span class="fa fa-chevron-down"></span></a> |
|
82 | 82 | |
83 | 83 | <div class="collapse" id="comments-collapse"> |
84 | 84 | <?php |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | <?php endif; ?> |
89 | 89 | </footer><!-- .footer-meta --> |
90 | 90 | |
91 | - <?php edit_post_link( esc_html__( 'Edit', 'lsx' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?> |
|
91 | + <?php edit_post_link(esc_html__('Edit', 'lsx'), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>'); ?> |
|
92 | 92 | |
93 | 93 | <?php lsx_entry_bottom(); ?> |
94 | 94 |
@@ -12,20 +12,20 @@ discard block |
||
12 | 12 | |
13 | 13 | <?php |
14 | 14 | $format = get_post_format(); |
15 | - if ( false === $format ) { |
|
15 | + if (false === $format) { |
|
16 | 16 | $format = 'standard'; |
17 | 17 | } |
18 | 18 | $format_link = get_post_format_link($format); |
19 | 19 | $format = lsx_translate_format_to_fontawesome($format); |
20 | 20 | ?> |
21 | 21 | |
22 | - <?php if ( ! is_single() ) { ?> |
|
22 | + <?php if ( ! is_single()) { ?> |
|
23 | 23 | <header class="entry-header"> |
24 | 24 | <h1 class="entry-title"> |
25 | - <?php if ( has_post_thumbnail() ) { ?> |
|
26 | - <a href="<?php echo esc_url($format_link) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
25 | + <?php if (has_post_thumbnail()) { ?> |
|
26 | + <a href="<?php echo esc_url($format_link) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr($format) ?>"></a> |
|
27 | 27 | <?php } else { ?> |
28 | - <a href="<?php echo esc_url($format_link) ?>" class="format-link fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
28 | + <a href="<?php echo esc_url($format_link) ?>" class="format-link fa fa-<?php echo esc_attr($format) ?>"></a> |
|
29 | 29 | <?php } ?> |
30 | 30 | |
31 | 31 | <span><?php the_title(); ?></span> |
@@ -39,36 +39,36 @@ discard block |
||
39 | 39 | |
40 | 40 | <div class="entry-content"> |
41 | 41 | <?php |
42 | - if ( ! is_singular() ) { |
|
42 | + if ( ! is_singular()) { |
|
43 | 43 | the_excerpt(); |
44 | 44 | } else { |
45 | 45 | the_content(); |
46 | 46 | |
47 | - wp_link_pages( array( |
|
47 | + wp_link_pages(array( |
|
48 | 48 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
49 | 49 | 'after' => '</div></div>', |
50 | 50 | 'link_before' => '<span>', |
51 | 51 | 'link_after' => '</span>' |
52 | - ) ); |
|
52 | + )); |
|
53 | 53 | } ?> |
54 | 54 | </div><!-- .entry-content --> |
55 | 55 | |
56 | 56 | <footer class="footer-meta"> |
57 | - <?php if ( has_tag() || class_exists( 'LSX_Sharing' ) || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) : ?> |
|
57 | + <?php if (has_tag() || class_exists('LSX_Sharing') || (function_exists('sharing_display') || class_exists('Jetpack_Likes'))) : ?> |
|
58 | 58 | <div class="post-tags-wrapper"> |
59 | 59 | <?php lsx_content_post_tags(); ?> |
60 | 60 | |
61 | 61 | <?php |
62 | - if ( class_exists( 'LSX_Sharing' ) ) { |
|
62 | + if (class_exists('LSX_Sharing')) { |
|
63 | 63 | lsx_content_sharing(); |
64 | 64 | } else { |
65 | - if ( function_exists( 'sharing_display' ) ) { |
|
66 | - sharing_display( '', true ); |
|
65 | + if (function_exists('sharing_display')) { |
|
66 | + sharing_display('', true); |
|
67 | 67 | } |
68 | 68 | |
69 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
69 | + if (class_exists('Jetpack_Likes')) { |
|
70 | 70 | $custom_likes = new Jetpack_Likes; |
71 | - echo wp_kses_post( $custom_likes->post_likes( '' ) ); |
|
71 | + echo wp_kses_post($custom_likes->post_likes('')); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | ?> |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | |
78 | 78 | <?php |
79 | 79 | // If comments are open or we have at least one comment, load up the comment template |
80 | - if ( comments_open() || '0' != get_comments_number() ) : ?> |
|
81 | - <a class="comments-link post-meta-link" data-toggle="collapse" href="#comments-collapse"><strong><?php echo esc_html( get_comments_number() ) ?></strong> <?php esc_html_e('Comments','lsx'); ?> <span class="fa fa-chevron-down"></span></a> |
|
80 | + if (comments_open() || '0' != get_comments_number()) : ?> |
|
81 | + <a class="comments-link post-meta-link" data-toggle="collapse" href="#comments-collapse"><strong><?php echo esc_html(get_comments_number()) ?></strong> <?php esc_html_e('Comments', 'lsx'); ?> <span class="fa fa-chevron-down"></span></a> |
|
82 | 82 | |
83 | 83 | <div class="collapse" id="comments-collapse"> |
84 | 84 | <?php |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | <?php endif; ?> |
89 | 89 | </footer><!-- .footer-meta --> |
90 | 90 | |
91 | - <?php edit_post_link( esc_html__( 'Edit', 'lsx' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?> |
|
91 | + <?php edit_post_link(esc_html__('Edit', 'lsx'), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>'); ?> |
|
92 | 92 | |
93 | 93 | <?php lsx_entry_bottom(); ?> |
94 | 94 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Yoast Breadcrumbs on Twitter Bootstrap |
@@ -10,21 +10,21 @@ discard block |
||
10 | 10 | * @param string $sep Your custom separator |
11 | 11 | */ |
12 | 12 | function lsx_breadcrumbs() { |
13 | - if (!function_exists('yoast_breadcrumb') && !function_exists('woocommerce_breadcrumb')) { |
|
13 | + if ( ! function_exists('yoast_breadcrumb') && ! function_exists('woocommerce_breadcrumb')) { |
|
14 | 14 | return null; |
15 | 15 | } |
16 | 16 | |
17 | 17 | $show_on_front = get_option('show_on_front'); |
18 | - if ( ('posts' == $show_on_front && is_home()) || ('page' == $show_on_front && is_front_page()) ) { |
|
18 | + if (('posts' == $show_on_front && is_home()) || ('page' == $show_on_front && is_front_page())) { |
|
19 | 19 | return; |
20 | 20 | } |
21 | 21 | |
22 | - if(function_exists('woocommerce_breadcrumb')){ |
|
22 | + if (function_exists('woocommerce_breadcrumb')) { |
|
23 | 23 | ob_start(); |
24 | 24 | woocommerce_breadcrumb(); |
25 | 25 | $output = ob_get_clean(); |
26 | 26 | $output = str_replace('woocommerce-breadcrumb', 'woocommerce-breadcrumb breadcrumbs-container', $output); |
27 | - }elseif(function_exists('yoast_breadcrumb')){ |
|
27 | + }elseif (function_exists('yoast_breadcrumb')) { |
|
28 | 28 | // Default Yoast Breadcrumbs Separator |
29 | 29 | $old_sep = '\»\;'; |
30 | 30 | |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | $output = '<div class="breadcrumbs-container">' . $output . '</div>'; |
43 | 43 | } |
44 | 44 | |
45 | - $output = apply_filters('lsx_breadcrumbs',$output); |
|
45 | + $output = apply_filters('lsx_breadcrumbs', $output); |
|
46 | 46 | |
47 | - echo wp_kses_post( $output ); |
|
47 | + echo wp_kses_post($output); |
|
48 | 48 | } |
49 | -add_action( 'lsx_content_top', 'lsx_breadcrumbs', 100 ); |
|
49 | +add_action('lsx_content_top', 'lsx_breadcrumbs', 100); |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * Replaces the seperator with a blank space. |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | function lsx_breadcrumbs_seperator_filter($seperator) { |
56 | 56 | return ''; |
57 | 57 | } |
58 | -add_filter( 'wpseo_breadcrumb_separator', 'lsx_breadcrumbs_seperator_filter' ); |
|
58 | +add_filter('wpseo_breadcrumb_separator', 'lsx_breadcrumbs_seperator_filter'); |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Custom template tags for this theme. |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @package lsx |
65 | 65 | */ |
66 | -if ( ! function_exists( 'lsx_site_title' ) ) : |
|
66 | +if ( ! function_exists('lsx_site_title')) : |
|
67 | 67 | /** |
68 | 68 | * Displays logo when applicable |
69 | 69 | * |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | function lsx_site_title() { |
73 | 73 | ?> |
74 | 74 | <div class="site-branding"> |
75 | - <h1 class="site-title"><a title="<?php bloginfo( 'name' ); ?>" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> |
|
76 | - <p class="site-description"><?php bloginfo( 'description' ); ?></p> |
|
75 | + <h1 class="site-title"><a title="<?php bloginfo('name'); ?>" href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></h1> |
|
76 | + <p class="site-description"><?php bloginfo('description'); ?></p> |
|
77 | 77 | </div> |
78 | 78 | <?php |
79 | 79 | } |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | /** |
83 | 83 | * Add customisable post meta. |
84 | 84 | */ |
85 | -if ( ! function_exists( 'lsx_post_meta' ) ) { |
|
85 | +if ( ! function_exists('lsx_post_meta')) { |
|
86 | 86 | function lsx_post_meta() { |
87 | - if ( ( is_page() && ! ( is_home() || is_front_page() ) ) && ! is_page_template( 'page-templates/template-blog.php' ) ) { |
|
87 | + if ((is_page() && ! (is_home() || is_front_page())) && ! is_page_template('page-templates/template-blog.php')) { |
|
88 | 88 | return; |
89 | 89 | } |
90 | 90 | ?> |
@@ -99,105 +99,105 @@ discard block |
||
99 | 99 | /** |
100 | 100 | * Add customisable post meta: post date |
101 | 101 | */ |
102 | -if ( ! function_exists( 'lsx_post_meta_date' ) ) { |
|
102 | +if ( ! function_exists('lsx_post_meta_date')) { |
|
103 | 103 | function lsx_post_meta_date() { |
104 | 104 | $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; |
105 | 105 | |
106 | - $time_string = sprintf( $time_string, |
|
107 | - esc_attr( get_the_date( 'c' ) ), |
|
106 | + $time_string = sprintf($time_string, |
|
107 | + esc_attr(get_the_date('c')), |
|
108 | 108 | get_the_date(), |
109 | - esc_attr( get_the_modified_date( 'c' ) ), |
|
109 | + esc_attr(get_the_modified_date('c')), |
|
110 | 110 | get_the_modified_date() |
111 | 111 | ); |
112 | 112 | |
113 | - printf( '<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>', |
|
114 | - esc_html_x( 'Posted on:', 'Used before publish date.', 'lsx' ), |
|
115 | - esc_url( get_permalink() ), |
|
116 | - wp_kses_post( $time_string ) |
|
113 | + printf('<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>', |
|
114 | + esc_html_x('Posted on:', 'Used before publish date.', 'lsx'), |
|
115 | + esc_url(get_permalink()), |
|
116 | + wp_kses_post($time_string) |
|
117 | 117 | ); |
118 | 118 | } |
119 | 119 | } |
120 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_date', 10 ); |
|
120 | +add_action('lsx_content_post_meta', 'lsx_post_meta_date', 10); |
|
121 | 121 | |
122 | 122 | /** |
123 | 123 | * Add customisable post meta: post author |
124 | 124 | */ |
125 | -if ( ! function_exists( 'lsx_post_meta_author' ) ) { |
|
125 | +if ( ! function_exists('lsx_post_meta_author')) { |
|
126 | 126 | function lsx_post_meta_author() { |
127 | 127 | $author = get_the_author(); |
128 | - $author_url = esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); |
|
128 | + $author_url = esc_url(get_author_posts_url(get_the_author_meta('ID'))); |
|
129 | 129 | |
130 | - if ( empty( $author ) ) { |
|
130 | + if (empty($author)) { |
|
131 | 131 | global $post; |
132 | 132 | |
133 | - $author = get_user_by( 'ID', $post->post_author ); |
|
133 | + $author = get_user_by('ID', $post->post_author); |
|
134 | 134 | $author = $author->display_name; |
135 | - $author_url = esc_url( get_author_posts_url( $post->post_author ) ); |
|
135 | + $author_url = esc_url(get_author_posts_url($post->post_author)); |
|
136 | 136 | } |
137 | 137 | |
138 | - printf( '<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>', |
|
139 | - esc_html_x( 'Posted by:', 'Used before post author name.', 'lsx' ), |
|
138 | + printf('<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>', |
|
139 | + esc_html_x('Posted by:', 'Used before post author name.', 'lsx'), |
|
140 | 140 | $author_url, |
141 | 141 | $author |
142 | 142 | ); |
143 | 143 | } |
144 | 144 | } |
145 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_author', 20 ); |
|
145 | +add_action('lsx_content_post_meta', 'lsx_post_meta_author', 20); |
|
146 | 146 | |
147 | 147 | /** |
148 | 148 | * Add customisable post meta: post category(ies) |
149 | 149 | */ |
150 | -if ( ! function_exists( 'lsx_post_meta_category' ) ) { |
|
150 | +if ( ! function_exists('lsx_post_meta_category')) { |
|
151 | 151 | function lsx_post_meta_category() { |
152 | - $post_categories = wp_get_post_categories( get_the_ID() ); |
|
152 | + $post_categories = wp_get_post_categories(get_the_ID()); |
|
153 | 153 | $cats = array(); |
154 | 154 | |
155 | - foreach( $post_categories as $c ) { |
|
156 | - $cat = get_category( $c ); |
|
157 | - $cats[] = '<a href="' . get_category_link( $cat->term_id ) . '" title="' . sprintf( esc_html__( 'View all posts in %s' , 'lsx' ), $cat->name ) . '" ' . '>' . $cat->name . '</a>'; |
|
155 | + foreach ($post_categories as $c) { |
|
156 | + $cat = get_category($c); |
|
157 | + $cats[] = '<a href="' . get_category_link($cat->term_id) . '" title="' . sprintf(esc_html__('View all posts in %s', 'lsx'), $cat->name) . '" ' . '>' . $cat->name . '</a>'; |
|
158 | 158 | } |
159 | 159 | |
160 | - if ( ! empty( $cats ) ) { |
|
160 | + if ( ! empty($cats)) { |
|
161 | 161 | ?> |
162 | - <span class="post-meta-categories"><span><?php esc_html_e( 'Posted in:', 'lsx' ); ?></span> <?php echo wp_kses_post( implode( ', ', $cats ) ); ?></span> |
|
162 | + <span class="post-meta-categories"><span><?php esc_html_e('Posted in:', 'lsx'); ?></span> <?php echo wp_kses_post(implode(', ', $cats)); ?></span> |
|
163 | 163 | <?php |
164 | 164 | } |
165 | 165 | } |
166 | 166 | } |
167 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_category', 30 ); |
|
167 | +add_action('lsx_content_post_meta', 'lsx_post_meta_category', 30); |
|
168 | 168 | |
169 | 169 | /** |
170 | 170 | * Add customisable post meta: post tag(s) |
171 | 171 | */ |
172 | -if ( ! function_exists( 'lsx_post_tags' ) ) { |
|
172 | +if ( ! function_exists('lsx_post_tags')) { |
|
173 | 173 | function lsx_post_tags() { |
174 | - if ( has_tag() ) : |
|
174 | + if (has_tag()) : |
|
175 | 175 | ?> |
176 | 176 | <div class="post-tags"> |
177 | - <span><?php esc_html_e( 'Tagged as:', 'lsx' ); ?></span> <?php echo wp_kses_post( get_the_tag_list( '' ) ); ?> |
|
177 | + <span><?php esc_html_e('Tagged as:', 'lsx'); ?></span> <?php echo wp_kses_post(get_the_tag_list('')); ?> |
|
178 | 178 | </div> |
179 | 179 | <?php |
180 | 180 | endif; |
181 | 181 | } |
182 | 182 | } |
183 | -add_action( 'lsx_content_post_tags', 'lsx_post_tags', 10 ); |
|
183 | +add_action('lsx_content_post_tags', 'lsx_post_tags', 10); |
|
184 | 184 | |
185 | 185 | /** |
186 | 186 | * Sharing buttons. |
187 | 187 | */ |
188 | -if ( ! function_exists( 'lsx_sharing_output' ) ) { |
|
188 | +if ( ! function_exists('lsx_sharing_output')) { |
|
189 | 189 | function lsx_sharing_output() { |
190 | 190 | global $lsx_sharing; |
191 | - echo wp_kses_post( $lsx_sharing->sharing_buttons() ); |
|
191 | + echo wp_kses_post($lsx_sharing->sharing_buttons()); |
|
192 | 192 | } |
193 | 193 | } |
194 | -add_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 ); |
|
194 | +add_action('lsx_content_sharing', 'lsx_sharing_output', 20); |
|
195 | 195 | |
196 | 196 | /** |
197 | 197 | * Add customisable post info: related posts |
198 | 198 | */ |
199 | 199 | function lsx_related_posts() { |
200 | - if ( is_singular( 'post' ) && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
200 | + if (is_singular('post') && class_exists('Jetpack_RelatedPosts')) { |
|
201 | 201 | ?> |
202 | 202 | <div class="row row-related-posts"> |
203 | 203 | <div class="col-md-12"> |
@@ -207,15 +207,15 @@ discard block |
||
207 | 207 | <?php |
208 | 208 | } |
209 | 209 | } |
210 | -add_action( 'lsx_entry_bottom', 'lsx_related_posts', 10 ); |
|
210 | +add_action('lsx_entry_bottom', 'lsx_related_posts', 10); |
|
211 | 211 | |
212 | 212 | /** |
213 | 213 | * Translate post format to Font Awesome class |
214 | 214 | */ |
215 | 215 | |
216 | -if ( ! function_exists( 'lsx_translate_format_to_fontawesome' ) ) { |
|
217 | - function lsx_translate_format_to_fontawesome( $format ) { |
|
218 | - switch ( $format ) { |
|
216 | +if ( ! function_exists('lsx_translate_format_to_fontawesome')) { |
|
217 | + function lsx_translate_format_to_fontawesome($format) { |
|
218 | + switch ($format) { |
|
219 | 219 | case 'image': |
220 | 220 | $format = 'camera'; |
221 | 221 | break; |
@@ -260,45 +260,45 @@ discard block |
||
260 | 260 | * to be added/modified where necessary. |
261 | 261 | */ |
262 | 262 | |
263 | -if ( ! function_exists( 'lsx_portfolio_meta' ) ) { |
|
263 | +if ( ! function_exists('lsx_portfolio_meta')) { |
|
264 | 264 | function lsx_portfolio_meta() { |
265 | 265 | ?> |
266 | 266 | <div id="portfolio-meta" class="portfolio-meta info-box-sticky info-box sticky-wrapper"> |
267 | 267 | <?php |
268 | - $client = get_post_meta(get_the_ID(),'lsx-client',true); |
|
269 | - if(false != $client){ ?> |
|
268 | + $client = get_post_meta(get_the_ID(), 'lsx-client', true); |
|
269 | + if (false != $client) { ?> |
|
270 | 270 | <div class="portfolio-client"> |
271 | - <span><span class="fa fa-user"></span><?php esc_html_e( 'Client','lsx' ); ?></span> |
|
272 | - <span><?php echo esc_html( $client ); ?></span> |
|
271 | + <span><span class="fa fa-user"></span><?php esc_html_e('Client', 'lsx'); ?></span> |
|
272 | + <span><?php echo esc_html($client); ?></span> |
|
273 | 273 | </div> |
274 | 274 | <?php } ?> |
275 | 275 | |
276 | 276 | <?php |
277 | - $portfolio_type = get_the_term_list( get_the_ID(), 'jetpack-portfolio-type', '', ', ', '' ); |
|
277 | + $portfolio_type = get_the_term_list(get_the_ID(), 'jetpack-portfolio-type', '', ', ', ''); |
|
278 | 278 | |
279 | - if($portfolio_type){ |
|
279 | + if ($portfolio_type) { |
|
280 | 280 | ?> |
281 | 281 | <div class="portfolio-industry"> |
282 | - <span><span class="fa fa-folder-open"></span><?php esc_html_e( 'Industry', 'lsx' ); ?></span> |
|
283 | - <?php echo wp_kses_post( $portfolio_type ); ?> |
|
282 | + <span><span class="fa fa-folder-open"></span><?php esc_html_e('Industry', 'lsx'); ?></span> |
|
283 | + <?php echo wp_kses_post($portfolio_type); ?> |
|
284 | 284 | </div> |
285 | 285 | <?php } ?> |
286 | 286 | |
287 | 287 | <?php |
288 | - $services = get_the_term_list( get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '' ); |
|
289 | - if(false != $services){ ?> |
|
288 | + $services = get_the_term_list(get_the_ID(), 'jetpack-portfolio-tag', '', ', ', ''); |
|
289 | + if (false != $services) { ?> |
|
290 | 290 | <div class="portfolio-services"> |
291 | - <span><span class="fa fa-cog"></span><?php esc_html_e( 'Services', 'lsx' ); ?></span> |
|
292 | - <?php echo wp_kses_post( $services ); ?> |
|
291 | + <span><span class="fa fa-cog"></span><?php esc_html_e('Services', 'lsx'); ?></span> |
|
292 | + <?php echo wp_kses_post($services); ?> |
|
293 | 293 | </div> |
294 | 294 | <?php } ?> |
295 | 295 | |
296 | 296 | <?php |
297 | - $website = esc_url( get_post_meta(get_the_ID(),'lsx-website',true) ); |
|
298 | - if(false != $website){ ?> |
|
297 | + $website = esc_url(get_post_meta(get_the_ID(), 'lsx-website', true)); |
|
298 | + if (false != $website) { ?> |
|
299 | 299 | <div class="portfolio-website"> |
300 | - <span><span class="fa fa-link"></span><?php esc_html_e( 'Website', 'lsx' ); ?></span> |
|
301 | - <a target="_blank" href="<?php echo esc_url( $website ); ?>"><?php echo esc_html( $website ) ?></a> |
|
300 | + <span><span class="fa fa-link"></span><?php esc_html_e('Website', 'lsx'); ?></span> |
|
301 | + <a target="_blank" href="<?php echo esc_url($website); ?>"><?php echo esc_html($website) ?></a> |
|
302 | 302 | </div> |
303 | 303 | <?php } ?> |
304 | 304 | |
@@ -312,29 +312,29 @@ discard block |
||
312 | 312 | * |
313 | 313 | */ |
314 | 314 | |
315 | -if ( ! function_exists( 'lsx_portfolio_gallery' ) ) { |
|
315 | +if ( ! function_exists('lsx_portfolio_gallery')) { |
|
316 | 316 | function lsx_portfolio_gallery() { |
317 | 317 | |
318 | - $media = get_attached_media( 'image' ); |
|
318 | + $media = get_attached_media('image'); |
|
319 | 319 | $media_array = array(); |
320 | 320 | $post_thumbnail_id = get_post_thumbnail_id(get_the_ID()); |
321 | 321 | |
322 | - if(!empty($media)){ |
|
323 | - foreach($media as $media_item){ |
|
324 | - if($post_thumbnail_id != $media_item->ID) { |
|
322 | + if ( ! empty($media)) { |
|
323 | + foreach ($media as $media_item) { |
|
324 | + if ($post_thumbnail_id != $media_item->ID) { |
|
325 | 325 | $media_array[] = $media_item->ID; |
326 | 326 | } |
327 | 327 | } |
328 | 328 | |
329 | - if(!empty($media_array)){ |
|
330 | - echo wp_kses_post( gallery_shortcode( array( 'size' => 'full', 'ids' => implode( ',', $media_array ) ) ) ); |
|
329 | + if ( ! empty($media_array)) { |
|
330 | + echo wp_kses_post(gallery_shortcode(array('size' => 'full', 'ids' => implode(',', $media_array)))); |
|
331 | 331 | } |
332 | 332 | } |
333 | 333 | |
334 | 334 | } |
335 | 335 | } |
336 | 336 | |
337 | -if ( ! function_exists( 'lsx_paging_nav' ) ) : |
|
337 | +if ( ! function_exists('lsx_paging_nav')) : |
|
338 | 338 | /** |
339 | 339 | * Display navigation to next/previous set of posts when applicable. |
340 | 340 | * |
@@ -342,33 +342,33 @@ discard block |
||
342 | 342 | */ |
343 | 343 | function lsx_paging_nav() { |
344 | 344 | // Don't print empty markup if there's only one page. |
345 | - if ( $GLOBALS['wp_query']->max_num_pages < 2 ) { |
|
345 | + if ($GLOBALS['wp_query']->max_num_pages < 2) { |
|
346 | 346 | return; |
347 | 347 | } |
348 | 348 | |
349 | - if(current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')){ |
|
349 | + if (current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')) { |
|
350 | 350 | return true; |
351 | - }elseif(function_exists('wp_pagenavi')){ |
|
351 | + }elseif (function_exists('wp_pagenavi')) { |
|
352 | 352 | wp_pagenavi(); |
353 | - }else{ |
|
353 | + } else { |
|
354 | 354 | |
355 | 355 | $labels = array( |
356 | - 'next' => '<span class="meta-nav">←</span> '.esc_html__( 'Older posts', 'lsx' ), |
|
357 | - 'previous' => esc_html__( 'Newer posts', 'lsx' ).' <span class="meta-nav">→</span>', |
|
358 | - 'title' => esc_html__( 'Posts navigation', 'lsx' ) |
|
356 | + 'next' => '<span class="meta-nav">←</span> ' . esc_html__('Older posts', 'lsx'), |
|
357 | + 'previous' => esc_html__('Newer posts', 'lsx') . ' <span class="meta-nav">→</span>', |
|
358 | + 'title' => esc_html__('Posts navigation', 'lsx') |
|
359 | 359 | ); |
360 | - $labels = apply_filters('lsx_post_navigation_labels',$labels); |
|
360 | + $labels = apply_filters('lsx_post_navigation_labels', $labels); |
|
361 | 361 | ?> |
362 | 362 | <nav class="navigation paging-navigation" role="navigation"> |
363 | 363 | <div class="lsx-breaker"></div> |
364 | - <h1 class="screen-reader-text"><?php echo esc_html( $labels['title'] ); ?></h1> |
|
364 | + <h1 class="screen-reader-text"><?php echo esc_html($labels['title']); ?></h1> |
|
365 | 365 | <div class="nav-links"> |
366 | - <?php if ( get_next_posts_link() ) : ?> |
|
367 | - <div class="nav-previous"><?php next_posts_link( $labels['next'] ); ?></div> |
|
366 | + <?php if (get_next_posts_link()) : ?> |
|
367 | + <div class="nav-previous"><?php next_posts_link($labels['next']); ?></div> |
|
368 | 368 | <?php endif; ?> |
369 | 369 | |
370 | - <?php if ( get_previous_posts_link() ) : ?> |
|
371 | - <div class="nav-next"><?php previous_posts_link( $labels['previous'] ); ?></div> |
|
370 | + <?php if (get_previous_posts_link()) : ?> |
|
371 | + <div class="nav-next"><?php previous_posts_link($labels['previous']); ?></div> |
|
372 | 372 | <?php endif; ?> |
373 | 373 | |
374 | 374 | <div class="clearfix"></div> |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | } |
380 | 380 | endif; |
381 | 381 | |
382 | -if ( ! function_exists( 'lsx_post_nav' ) ) : |
|
382 | +if ( ! function_exists('lsx_post_nav')) : |
|
383 | 383 | /** |
384 | 384 | * Display navigation to next/previous post when applicable. |
385 | 385 | * |
@@ -387,10 +387,10 @@ discard block |
||
387 | 387 | */ |
388 | 388 | function lsx_post_nav() { |
389 | 389 | // Don't print empty markup if there's nowhere to navigate. |
390 | - $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); |
|
391 | - $next = get_adjacent_post( false, '', false ); |
|
390 | + $previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true); |
|
391 | + $next = get_adjacent_post(false, '', false); |
|
392 | 392 | |
393 | - if ( ! $next && ! $previous ) { |
|
393 | + if ( ! $next && ! $previous) { |
|
394 | 394 | return; |
395 | 395 | } |
396 | 396 | ?> |
@@ -400,14 +400,14 @@ discard block |
||
400 | 400 | <div class="nav-links pager row"> |
401 | 401 | <div class="previous col-md-6"> |
402 | 402 | <?php |
403 | - $previous_post = get_previous_post_link( '%link', '<p class="nav-links-description">'._x( 'Previous Post', 'Previous post link', 'lsx' ).'</p><h3>%title</h3>' ); |
|
404 | - echo wp_kses_post( $previous_post ); |
|
403 | + $previous_post = get_previous_post_link('%link', '<p class="nav-links-description">' . _x('Previous Post', 'Previous post link', 'lsx') . '</p><h3>%title</h3>'); |
|
404 | + echo wp_kses_post($previous_post); |
|
405 | 405 | ?> |
406 | 406 | </div> |
407 | 407 | <div class="next col-md-6"> |
408 | 408 | <?php |
409 | - $next_post = get_next_post_link( '%link', '<p class="nav-links-description">'._x( 'Next Post', 'Next post link', 'lsx' ).'</p><h3>%title</h3>' ); |
|
410 | - echo wp_kses_post( $next_post ); |
|
409 | + $next_post = get_next_post_link('%link', '<p class="nav-links-description">' . _x('Next Post', 'Next post link', 'lsx') . '</p><h3>%title</h3>'); |
|
410 | + echo wp_kses_post($next_post); |
|
411 | 411 | ?> |
412 | 412 | </div> |
413 | 413 | </div><!-- .nav-links --> |
@@ -423,16 +423,16 @@ discard block |
||
423 | 423 | * @subpackage template-tags |
424 | 424 | * @category header |
425 | 425 | */ |
426 | -if(!function_exists('lsx_site_identity')){ |
|
427 | - function lsx_site_identity(){ |
|
426 | +if ( ! function_exists('lsx_site_identity')) { |
|
427 | + function lsx_site_identity() { |
|
428 | 428 | |
429 | - if ( function_exists('has_custom_logo') && has_custom_logo() ) { |
|
429 | + if (function_exists('has_custom_logo') && has_custom_logo()) { |
|
430 | 430 | the_custom_logo(); |
431 | - }elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { |
|
431 | + }elseif (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) { |
|
432 | 432 | jetpack_the_site_logo(); |
433 | - }else{ |
|
433 | + } else { |
|
434 | 434 | // shouldn't show both together.. its just strange |
435 | - if(true == get_theme_mod('site_logo_header_text',1)){ |
|
435 | + if (true == get_theme_mod('site_logo_header_text', 1)) { |
|
436 | 436 | lsx_site_title(); |
437 | 437 | } |
438 | 438 | } |
@@ -447,29 +447,29 @@ discard block |
||
447 | 447 | * @subpackage template-tags |
448 | 448 | * @category navigation |
449 | 449 | */ |
450 | -if(!function_exists('lsx_navbar_header')){ |
|
451 | - function lsx_navbar_header(){ ?> |
|
450 | +if ( ! function_exists('lsx_navbar_header')) { |
|
451 | + function lsx_navbar_header() { ?> |
|
452 | 452 | <div class="navbar-header" itemscope itemtype="http://schema.org/WebPage"> |
453 | 453 | |
454 | 454 | <?php |
455 | - $nav_menu = get_theme_mod('nav_menu_locations',false); |
|
455 | + $nav_menu = get_theme_mod('nav_menu_locations', false); |
|
456 | 456 | //print_r(get_nav_menu_locations()); |
457 | 457 | |
458 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
458 | + if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?> |
|
459 | 459 | <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".primary-navbar"> |
460 | - <span class="sr-only"><?php esc_html_e( 'Toggle navigation', 'lsx' ); ?></span> |
|
460 | + <span class="sr-only"><?php esc_html_e('Toggle navigation', 'lsx'); ?></span> |
|
461 | 461 | <span class="icon-bar"></span> |
462 | 462 | <span class="icon-bar"></span> |
463 | 463 | <span class="icon-bar"></span> |
464 | 464 | </button> |
465 | - <span class="mobile-menu-title"><?php esc_html_e( 'Menu', 'lsx' ); ?></span> |
|
465 | + <span class="mobile-menu-title"><?php esc_html_e('Menu', 'lsx'); ?></span> |
|
466 | 466 | <?php } ?> |
467 | 467 | <?php lsx_site_identity(); ?> |
468 | 468 | </div> |
469 | 469 | <?php } |
470 | 470 | } |
471 | 471 | //the if statement is for backwards compatability with previous versions of the theme. |
472 | -add_action('lsx_nav_before','lsx_navbar_header'); |
|
472 | +add_action('lsx_nav_before', 'lsx_navbar_header'); |
|
473 | 473 | |
474 | 474 | /** |
475 | 475 | * Outputs the Nav Menu |
@@ -478,16 +478,16 @@ discard block |
||
478 | 478 | * @subpackage template-tags |
479 | 479 | * @category navigation |
480 | 480 | */ |
481 | -if(!function_exists('lsx_nav_menu')){ |
|
482 | - function lsx_nav_menu(){ |
|
483 | - $nav_menu = get_theme_mod('nav_menu_locations',false); |
|
481 | +if ( ! function_exists('lsx_nav_menu')) { |
|
482 | + function lsx_nav_menu() { |
|
483 | + $nav_menu = get_theme_mod('nav_menu_locations', false); |
|
484 | 484 | |
485 | 485 | //print_r(get_nav_menu_locations()); |
486 | 486 | |
487 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
487 | + if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?> |
|
488 | 488 | <nav class="primary-navbar collapse navbar-collapse"> |
489 | 489 | <?php |
490 | - wp_nav_menu( array( |
|
490 | + wp_nav_menu(array( |
|
491 | 491 | 'theme_location' => 'primary', |
492 | 492 | 'menu' => $nav_menu['primary'], |
493 | 493 | 'depth' => 3, |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | * @subpackage template-tags |
509 | 509 | * @category sitemap |
510 | 510 | */ |
511 | -function lsx_sitemap_pages(){ |
|
511 | +function lsx_sitemap_pages() { |
|
512 | 512 | $page_args = array( |
513 | 513 | 'post_type' => 'page', |
514 | 514 | 'posts_per_page'=> 99, |
@@ -516,13 +516,13 @@ discard block |
||
516 | 516 | 'post_type' => 'page', |
517 | 517 | ); |
518 | 518 | $pages = new WP_Query($page_args); |
519 | - if($pages->have_posts()){ |
|
519 | + if ($pages->have_posts()) { |
|
520 | 520 | |
521 | - echo '<h2>' . esc_html__( 'Pages', 'lsx' ) . '</h2>'; |
|
521 | + echo '<h2>' . esc_html__('Pages', 'lsx') . '</h2>'; |
|
522 | 522 | |
523 | 523 | echo '<ul>'; |
524 | - while($pages->have_posts()){ $pages->the_post(); |
|
525 | - echo '<li class="page_item page-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>'; |
|
524 | + while ($pages->have_posts()) { $pages->the_post(); |
|
525 | + echo '<li class="page_item page-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>'; |
|
526 | 526 | } |
527 | 527 | echo '</ul>'; |
528 | 528 | |
@@ -537,13 +537,13 @@ discard block |
||
537 | 537 | * @subpackage template-tags |
538 | 538 | * @category sitemap |
539 | 539 | */ |
540 | -function lsx_sitemap_custom_post_type(){ |
|
540 | +function lsx_sitemap_custom_post_type() { |
|
541 | 541 | $args = array( |
542 | 542 | 'public' => true, |
543 | 543 | '_builtin' => false |
544 | 544 | ); |
545 | - $post_types = get_post_types($args , 'names'); |
|
546 | - foreach($post_types as $post_type){ |
|
545 | + $post_types = get_post_types($args, 'names'); |
|
546 | + foreach ($post_types as $post_type) { |
|
547 | 547 | |
548 | 548 | $post_type_args = array( |
549 | 549 | 'post_type' => 'page', |
@@ -554,19 +554,19 @@ discard block |
||
554 | 554 | $post_type_items = new WP_Query($post_type_args); |
555 | 555 | |
556 | 556 | $post_type_object = get_post_type_object($post_type); |
557 | - if(null != $post_type_object){ |
|
557 | + if (null != $post_type_object) { |
|
558 | 558 | $title = $post_type_object->labels->name; |
559 | - }else{ |
|
559 | + } else { |
|
560 | 560 | $title = ucwords($post_type); |
561 | 561 | } |
562 | 562 | |
563 | - if($post_type_items->have_posts()){ |
|
563 | + if ($post_type_items->have_posts()) { |
|
564 | 564 | |
565 | - echo '<h2>' . esc_html( $title ) . '</h2>'; |
|
565 | + echo '<h2>' . esc_html($title) . '</h2>'; |
|
566 | 566 | |
567 | 567 | echo '<ul>'; |
568 | - while($post_type_items->have_posts()){ $post_type_items->the_post(); |
|
569 | - echo '<li class="' . esc_attr( get_post_type() ) . '_item ' . esc_attr( get_post_type() ) . '-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>'; |
|
568 | + while ($post_type_items->have_posts()) { $post_type_items->the_post(); |
|
569 | + echo '<li class="' . esc_attr(get_post_type()) . '_item ' . esc_attr(get_post_type()) . '-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>'; |
|
570 | 570 | } |
571 | 571 | echo '</ul>'; |
572 | 572 | |
@@ -582,20 +582,20 @@ discard block |
||
582 | 582 | * @subpackage template-tags |
583 | 583 | * @category sitemap |
584 | 584 | */ |
585 | -function lsx_sitemap_taxonomy_clouds(){ |
|
585 | +function lsx_sitemap_taxonomy_clouds() { |
|
586 | 586 | |
587 | - $taxonomy_args = array( |
|
587 | + $taxonomy_args = array( |
|
588 | 588 | 'public' => true, |
589 | 589 | '_builtin' => false |
590 | 590 | ); |
591 | 591 | $taxonomies = get_taxonomies($taxonomy_args); |
592 | - if(!empty($taxonomies)){ |
|
593 | - foreach($taxonomies as $taxonomy_id => $taxonomy) { |
|
592 | + if ( ! empty($taxonomies)) { |
|
593 | + foreach ($taxonomies as $taxonomy_id => $taxonomy) { |
|
594 | 594 | |
595 | - $tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id,'echo'=>false)); |
|
596 | - if(null != $tag_cloud){ |
|
597 | - echo '<h2>' . esc_html( $taxonomy ) . '</h2>'; |
|
598 | - echo '<aside id="' . esc_attr( $taxonomy_id ) . '" class="widget widget_' . esc_attr( $taxonomy_id ) . '">' . esc_html( $tag_cloud ) . '</aside>'; |
|
595 | + $tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id, 'echo'=>false)); |
|
596 | + if (null != $tag_cloud) { |
|
597 | + echo '<h2>' . esc_html($taxonomy) . '</h2>'; |
|
598 | + echo '<aside id="' . esc_attr($taxonomy_id) . '" class="widget widget_' . esc_attr($taxonomy_id) . '">' . esc_html($tag_cloud) . '</aside>'; |
|
599 | 599 | } |
600 | 600 | } |
601 | 601 | } |
@@ -608,15 +608,15 @@ discard block |
||
608 | 608 | * @subpackage hooks |
609 | 609 | * @category forms |
610 | 610 | */ |
611 | -add_action( 'lsx_footer_before', 'lsx_footer_subscription_cta', 10 ); |
|
611 | +add_action('lsx_footer_before', 'lsx_footer_subscription_cta', 10); |
|
612 | 612 | function lsx_footer_subscription_cta() { |
613 | - if(!function_exists('lsx_is_form_enabled')){ return; } |
|
613 | + if ( ! function_exists('lsx_is_form_enabled')) { return; } |
|
614 | 614 | $subscribe_form_id = lsx_is_form_enabled('subscribe'); |
615 | - if(false == $subscribe_form_id) { return; } |
|
615 | + if (false == $subscribe_form_id) { return; } |
|
616 | 616 | |
617 | 617 | //add Caldera Forms Fields Scripts |
618 | - if( defined( 'CFCORE_VER' ) ){ |
|
619 | - wp_enqueue_script( 'cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER ); |
|
618 | + if (defined('CFCORE_VER')) { |
|
619 | + wp_enqueue_script('cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER); |
|
620 | 620 | } |
621 | 621 | |
622 | 622 | ?> |
@@ -624,8 +624,8 @@ discard block |
||
624 | 624 | <div class="container"> |
625 | 625 | <div class="row"> |
626 | 626 | <div class="col-md-12"> |
627 | - <h2><?php esc_html_e( 'Subscribe to Our Newsletter', 'lsx' ); ?></h2> |
|
628 | - <?php echo do_shortcode( '[caldera_form id="'.$subscribe_form_id.'"]' ); ?> |
|
627 | + <h2><?php esc_html_e('Subscribe to Our Newsletter', 'lsx'); ?></h2> |
|
628 | + <?php echo do_shortcode('[caldera_form id="' . $subscribe_form_id . '"]'); ?> |
|
629 | 629 | </div> |
630 | 630 | </div> |
631 | 631 | </div> |
@@ -641,13 +641,13 @@ discard block |
||
641 | 641 | * @category menu |
642 | 642 | */ |
643 | 643 | function lsx_add_top_menu() { |
644 | - if ( has_nav_menu( 'top-menu' ) || has_nav_menu(' top-menu-left' ) ) : ?> |
|
644 | + if (has_nav_menu('top-menu') || has_nav_menu(' top-menu-left')) : ?> |
|
645 | 645 | <div id="top-menu" class="<?php lsx_top_menu_classes(); ?>"> |
646 | 646 | <div class="container"> |
647 | - <?php if ( has_nav_menu( 'top-menu' ) ) : ?> |
|
647 | + <?php if (has_nav_menu('top-menu')) : ?> |
|
648 | 648 | <nav class="top-menu"> |
649 | 649 | <?php |
650 | - wp_nav_menu( array( |
|
650 | + wp_nav_menu(array( |
|
651 | 651 | 'theme_location' => 'top-menu', |
652 | 652 | 'walker' => new Lsx_Bootstrap_Navwalker()) |
653 | 653 | ); |
@@ -655,10 +655,10 @@ discard block |
||
655 | 655 | </nav> |
656 | 656 | <?php endif; ?> |
657 | 657 | |
658 | - <?php if ( has_nav_menu( 'top-menu-left' ) ) : ?> |
|
658 | + <?php if (has_nav_menu('top-menu-left')) : ?> |
|
659 | 659 | <nav class="top-menu pull-left"> |
660 | 660 | <?php |
661 | - wp_nav_menu( array( |
|
661 | + wp_nav_menu(array( |
|
662 | 662 | 'theme_location' => 'top-menu-left', |
663 | 663 | 'walker' => new Lsx_Bootstrap_Navwalker()) |
664 | 664 | ); |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | </div> |
670 | 670 | <?php endif; |
671 | 671 | } |
672 | -add_action( 'lsx_header_top', 'lsx_add_top_menu' ); |
|
672 | +add_action('lsx_header_top', 'lsx_add_top_menu'); |
|
673 | 673 | |
674 | 674 | /** |
675 | 675 | * Checks if a caldera form with your slug exists |
@@ -678,24 +678,24 @@ discard block |
||
678 | 678 | * @subpackage template-tag |
679 | 679 | * @category forms |
680 | 680 | */ |
681 | -if ( class_exists('Caldera_Forms') && !function_exists( 'lsx_is_form_enabled' ) ) { |
|
681 | +if (class_exists('Caldera_Forms') && ! function_exists('lsx_is_form_enabled')) { |
|
682 | 682 | function lsx_is_form_enabled($slug = false) { |
683 | - if(false == $slug){ return false; } |
|
683 | + if (false == $slug) { return false; } |
|
684 | 684 | |
685 | 685 | $match = false; |
686 | - $forms = get_option( '_caldera_forms' , false ); |
|
687 | - if(false !== $forms ) { |
|
688 | - foreach($forms as $form_id=>$form_maybe){ |
|
689 | - if( trim(strtolower($slug)) == strtolower($form_maybe['name']) ){ |
|
686 | + $forms = get_option('_caldera_forms', false); |
|
687 | + if (false !== $forms) { |
|
688 | + foreach ($forms as $form_id=>$form_maybe) { |
|
689 | + if (trim(strtolower($slug)) == strtolower($form_maybe['name'])) { |
|
690 | 690 | $match = $form_id; |
691 | 691 | break; |
692 | 692 | } |
693 | 693 | } |
694 | 694 | } |
695 | - if( false === $match ){ |
|
696 | - $is_form = Caldera_Forms::get_form( strtolower( $slug ) ); |
|
697 | - if( !empty( $is_form ) ){ |
|
698 | - return strtolower( $slug ); |
|
695 | + if (false === $match) { |
|
696 | + $is_form = Caldera_Forms::get_form(strtolower($slug)); |
|
697 | + if ( ! empty($is_form)) { |
|
698 | + return strtolower($slug); |
|
699 | 699 | } |
700 | 700 | } |
701 | 701 | |
@@ -711,10 +711,10 @@ discard block |
||
711 | 711 | * @category urls |
712 | 712 | */ |
713 | 713 | function lsx_get_my_url() { |
714 | - if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) |
|
714 | + if ( ! preg_match('/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches)) |
|
715 | 715 | return false; |
716 | 716 | |
717 | - return esc_url_raw( $matches[1] ); |
|
717 | + return esc_url_raw($matches[1]); |
|
718 | 718 | } |
719 | 719 | |
720 | 720 | /** |
@@ -724,19 +724,19 @@ discard block |
||
724 | 724 | * @subpackage extras |
725 | 725 | * @category urls |
726 | 726 | */ |
727 | -function lsx_get_template_part($slug,$part) { |
|
727 | +function lsx_get_template_part($slug, $part) { |
|
728 | 728 | $template = array(); |
729 | 729 | $part = (string) $part; |
730 | - if ( '' !== $part ){ |
|
730 | + if ('' !== $part) { |
|
731 | 731 | $template = "{$slug}-{$part}.php"; |
732 | - }else{ |
|
732 | + } else { |
|
733 | 733 | $template = "{$slug}.php"; |
734 | 734 | } |
735 | - $file_path = apply_filters('lsx_content_path',false,$slug,$part); |
|
735 | + $file_path = apply_filters('lsx_content_path', false, $slug, $part); |
|
736 | 736 | |
737 | - if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) { |
|
738 | - load_template( $file_path.$template, false ); |
|
739 | - }else{ |
|
740 | - get_template_part($slug,$part); |
|
737 | + if (false !== $file_path && '' == locate_template(array($template)) && file_exists($file_path . $template)) { |
|
738 | + load_template($file_path . $template, false); |
|
739 | + } else { |
|
740 | + get_template_part($slug, $part); |
|
741 | 741 | } |
742 | 742 | } |
743 | 743 | \ No newline at end of file |