@@ -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 | 47 | echo $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 | ?> |
@@ -94,21 +94,21 @@ discard block |
||
94 | 94 | lsx_content_post_meta(); |
95 | 95 | ?> |
96 | 96 | |
97 | - <?php printf( '<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>', |
|
98 | - _x( 'Posted by:', 'Used before post author name.', 'lsx' ), |
|
99 | - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), |
|
97 | + <?php printf('<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>', |
|
98 | + _x('Posted by:', 'Used before post author name.', 'lsx'), |
|
99 | + esc_url(get_author_posts_url(get_the_author_meta('ID'))), |
|
100 | 100 | get_the_author() |
101 | 101 | ); ?> |
102 | 102 | |
103 | 103 | <?php |
104 | - $post_categories = wp_get_post_categories( get_the_ID() ); |
|
104 | + $post_categories = wp_get_post_categories(get_the_ID()); |
|
105 | 105 | $cats = array(); |
106 | - foreach($post_categories as $c){ |
|
107 | - $cat = get_category( $c ); |
|
108 | - $cats[] = '<a href="' . get_category_link( $cat->term_id ) . '" title="' . sprintf( __( "View all posts in %s" , 'lsx' ), $cat->name ) . '" ' . '>' . $cat->name.'</a>'; |
|
106 | + foreach ($post_categories as $c) { |
|
107 | + $cat = get_category($c); |
|
108 | + $cats[] = '<a href="' . get_category_link($cat->term_id) . '" title="' . sprintf(__("View all posts in %s", 'lsx'), $cat->name) . '" ' . '>' . $cat->name . '</a>'; |
|
109 | 109 | } |
110 | - if(!empty($cats)){ ?> |
|
111 | - <span class="post-meta-categories"><span><?php _e('Posted in:','lsx'); ?></span> <?php echo implode(', ', $cats); ?></span> |
|
110 | + if ( ! empty($cats)) { ?> |
|
111 | + <span class="post-meta-categories"><span><?php _e('Posted in:', 'lsx'); ?></span> <?php echo implode(', ', $cats); ?></span> |
|
112 | 112 | <?php } ?> |
113 | 113 | |
114 | 114 | <div class="clearfix"></div> |
@@ -121,33 +121,33 @@ discard block |
||
121 | 121 | /** |
122 | 122 | * Add customisable post meta: post date |
123 | 123 | */ |
124 | -if ( ! function_exists( 'lsx_post_meta_date' ) ) { |
|
124 | +if ( ! function_exists('lsx_post_meta_date')) { |
|
125 | 125 | function lsx_post_meta_date() { |
126 | 126 | $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; |
127 | 127 | |
128 | - $time_string = sprintf( $time_string, |
|
129 | - esc_attr( get_the_date( 'c' ) ), |
|
128 | + $time_string = sprintf($time_string, |
|
129 | + esc_attr(get_the_date('c')), |
|
130 | 130 | get_the_date(), |
131 | - esc_attr( get_the_modified_date( 'c' ) ), |
|
131 | + esc_attr(get_the_modified_date('c')), |
|
132 | 132 | get_the_modified_date() |
133 | 133 | ); |
134 | 134 | |
135 | - printf( '<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>', |
|
136 | - _x( 'Posted on:', 'Used before publish date.', 'lsx' ), |
|
137 | - esc_url( get_permalink() ), |
|
135 | + printf('<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>', |
|
136 | + _x('Posted on:', 'Used before publish date.', 'lsx'), |
|
137 | + esc_url(get_permalink()), |
|
138 | 138 | $time_string |
139 | 139 | ); |
140 | 140 | } |
141 | 141 | } |
142 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_date', 10 ); |
|
142 | +add_action('lsx_content_post_meta', 'lsx_post_meta_date', 10); |
|
143 | 143 | |
144 | 144 | /** |
145 | 145 | * Translate post format to Font Awesome class |
146 | 146 | */ |
147 | 147 | |
148 | -if ( ! function_exists( 'lsx_translate_format_to_fontawesome' ) ) { |
|
149 | - function lsx_translate_format_to_fontawesome( $format ) { |
|
150 | - switch ( $format ) { |
|
148 | +if ( ! function_exists('lsx_translate_format_to_fontawesome')) { |
|
149 | + function lsx_translate_format_to_fontawesome($format) { |
|
150 | + switch ($format) { |
|
151 | 151 | case 'image': |
152 | 152 | $format = 'camera'; |
153 | 153 | break; |
@@ -192,44 +192,44 @@ discard block |
||
192 | 192 | * to be added/modified where necessary. |
193 | 193 | */ |
194 | 194 | |
195 | -if ( ! function_exists( 'lsx_portfolio_meta' ) ) { |
|
195 | +if ( ! function_exists('lsx_portfolio_meta')) { |
|
196 | 196 | function lsx_portfolio_meta() { |
197 | 197 | ?> |
198 | 198 | <div id="portfolio-meta" class="portfolio-meta info-box-sticky info-box sticky-wrapper"> |
199 | 199 | <?php |
200 | - $client = get_post_meta(get_the_ID(),'lsx-client',true); |
|
201 | - if(false != $client){ ?> |
|
200 | + $client = get_post_meta(get_the_ID(), 'lsx-client', true); |
|
201 | + if (false != $client) { ?> |
|
202 | 202 | <div class="portfolio-client"> |
203 | - <span><span class="fa fa-user"></span><?php _e('Client','lsx'); ?></span> |
|
203 | + <span><span class="fa fa-user"></span><?php _e('Client', 'lsx'); ?></span> |
|
204 | 204 | <span><?php echo $client ?></span> |
205 | 205 | </div> |
206 | 206 | <?php } ?> |
207 | 207 | |
208 | 208 | <?php |
209 | - $portfolio_type = get_the_term_list( get_the_ID(), 'jetpack-portfolio-type', '', ', ', '' ); |
|
209 | + $portfolio_type = get_the_term_list(get_the_ID(), 'jetpack-portfolio-type', '', ', ', ''); |
|
210 | 210 | |
211 | - if($portfolio_type){ |
|
211 | + if ($portfolio_type) { |
|
212 | 212 | ?> |
213 | 213 | <div class="portfolio-industry"> |
214 | - <span><span class="fa fa-folder-open"></span><?php _e('Industry','lsx'); ?></span> |
|
214 | + <span><span class="fa fa-folder-open"></span><?php _e('Industry', 'lsx'); ?></span> |
|
215 | 215 | <?php echo $portfolio_type; ?> |
216 | 216 | </div> |
217 | 217 | <?php } ?> |
218 | 218 | |
219 | 219 | <?php |
220 | - $services = get_the_term_list( get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '' ); |
|
221 | - if(false != $services){ ?> |
|
220 | + $services = get_the_term_list(get_the_ID(), 'jetpack-portfolio-tag', '', ', ', ''); |
|
221 | + if (false != $services) { ?> |
|
222 | 222 | <div class="portfolio-services"> |
223 | - <span><span class="fa fa-cog"></span><?php _e('Services','lsx'); ?></span> |
|
223 | + <span><span class="fa fa-cog"></span><?php _e('Services', 'lsx'); ?></span> |
|
224 | 224 | <?php echo $services ?> |
225 | 225 | </div> |
226 | 226 | <?php } ?> |
227 | 227 | |
228 | 228 | <?php |
229 | - $website = esc_url( get_post_meta(get_the_ID(),'lsx-website',true) ); |
|
230 | - if(false != $website){ ?> |
|
229 | + $website = esc_url(get_post_meta(get_the_ID(), 'lsx-website', true)); |
|
230 | + if (false != $website) { ?> |
|
231 | 231 | <div class="portfolio-website"> |
232 | - <span><span class="fa fa-link"></span><?php _e('Website','lsx'); ?></span> |
|
232 | + <span><span class="fa fa-link"></span><?php _e('Website', 'lsx'); ?></span> |
|
233 | 233 | <a target="_blank" href="<?php echo esc_url($website); ?>"><?php echo $website ?></a> |
234 | 234 | </div> |
235 | 235 | <?php } ?> |
@@ -244,29 +244,29 @@ discard block |
||
244 | 244 | * |
245 | 245 | */ |
246 | 246 | |
247 | -if ( ! function_exists( 'lsx_portfolio_gallery' ) ) { |
|
247 | +if ( ! function_exists('lsx_portfolio_gallery')) { |
|
248 | 248 | function lsx_portfolio_gallery() { |
249 | 249 | |
250 | - $media = get_attached_media( 'image' ); |
|
250 | + $media = get_attached_media('image'); |
|
251 | 251 | $media_array = array(); |
252 | 252 | $post_thumbnail_id = get_post_thumbnail_id(get_the_ID()); |
253 | 253 | |
254 | - if(!empty($media)){ |
|
255 | - foreach($media as $media_item){ |
|
256 | - if($post_thumbnail_id != $media_item->ID) { |
|
254 | + if ( ! empty($media)) { |
|
255 | + foreach ($media as $media_item) { |
|
256 | + if ($post_thumbnail_id != $media_item->ID) { |
|
257 | 257 | $media_array[] = $media_item->ID; |
258 | 258 | } |
259 | 259 | } |
260 | 260 | |
261 | - if(!empty($media_array)){ |
|
262 | - echo gallery_shortcode(array('size'=>'full','ids'=>implode(',', $media_array))); |
|
261 | + if ( ! empty($media_array)) { |
|
262 | + echo gallery_shortcode(array('size'=>'full', 'ids'=>implode(',', $media_array))); |
|
263 | 263 | } |
264 | 264 | } |
265 | 265 | |
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
269 | -if ( ! function_exists( 'lsx_paging_nav' ) ) : |
|
269 | +if ( ! function_exists('lsx_paging_nav')) : |
|
270 | 270 | /** |
271 | 271 | * Display navigation to next/previous set of posts when applicable. |
272 | 272 | * |
@@ -274,22 +274,22 @@ discard block |
||
274 | 274 | */ |
275 | 275 | function lsx_paging_nav() { |
276 | 276 | // Don't print empty markup if there's only one page. |
277 | - if ( $GLOBALS['wp_query']->max_num_pages < 2 ) { |
|
277 | + if ($GLOBALS['wp_query']->max_num_pages < 2) { |
|
278 | 278 | return; |
279 | 279 | } |
280 | 280 | |
281 | - if(current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')){ |
|
281 | + if (current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')) { |
|
282 | 282 | return true; |
283 | - }elseif(function_exists('wp_pagenavi')){ |
|
283 | + }elseif (function_exists('wp_pagenavi')) { |
|
284 | 284 | wp_pagenavi(); |
285 | - }else{ |
|
285 | + } else { |
|
286 | 286 | |
287 | 287 | $labels = array( |
288 | - 'next' => '<span class="meta-nav">←</span> '.__( 'Older posts', 'lsx' ), |
|
289 | - 'previous' => __( 'Newer posts', 'lsx' ).' <span class="meta-nav">→</span>', |
|
290 | - 'title' => __( 'Posts navigation', 'lsx' ) |
|
288 | + 'next' => '<span class="meta-nav">←</span> ' . __('Older posts', 'lsx'), |
|
289 | + 'previous' => __('Newer posts', 'lsx') . ' <span class="meta-nav">→</span>', |
|
290 | + 'title' => __('Posts navigation', 'lsx') |
|
291 | 291 | ); |
292 | - $labels = apply_filters('lsx_post_navigation_labels',$labels); |
|
292 | + $labels = apply_filters('lsx_post_navigation_labels', $labels); |
|
293 | 293 | |
294 | 294 | extract($labels); |
295 | 295 | ?> |
@@ -297,12 +297,12 @@ discard block |
||
297 | 297 | <div class="lsx-breaker"></div> |
298 | 298 | <h1 class="screen-reader-text"><?php echo $title; ?></h1> |
299 | 299 | <div class="nav-links"> |
300 | - <?php if ( get_next_posts_link() ) : ?> |
|
301 | - <div class="nav-previous"><?php next_posts_link( $next ); ?></div> |
|
300 | + <?php if (get_next_posts_link()) : ?> |
|
301 | + <div class="nav-previous"><?php next_posts_link($next); ?></div> |
|
302 | 302 | <?php endif; ?> |
303 | 303 | |
304 | - <?php if ( get_previous_posts_link() ) : ?> |
|
305 | - <div class="nav-next"><?php previous_posts_link( $previous ); ?></div> |
|
304 | + <?php if (get_previous_posts_link()) : ?> |
|
305 | + <div class="nav-next"><?php previous_posts_link($previous); ?></div> |
|
306 | 306 | <?php endif; ?> |
307 | 307 | |
308 | 308 | <div class="clearfix"></div> |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | } |
314 | 314 | endif; |
315 | 315 | |
316 | -if ( ! function_exists( 'lsx_post_nav' ) ) : |
|
316 | +if ( ! function_exists('lsx_post_nav')) : |
|
317 | 317 | /** |
318 | 318 | * Display navigation to next/previous post when applicable. |
319 | 319 | * |
@@ -321,10 +321,10 @@ discard block |
||
321 | 321 | */ |
322 | 322 | function lsx_post_nav() { |
323 | 323 | // Don't print empty markup if there's nowhere to navigate. |
324 | - $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); |
|
325 | - $next = get_adjacent_post( false, '', false ); |
|
324 | + $previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true); |
|
325 | + $next = get_adjacent_post(false, '', false); |
|
326 | 326 | |
327 | - if ( ! $next && ! $previous ) { |
|
327 | + if ( ! $next && ! $previous) { |
|
328 | 328 | return; |
329 | 329 | } |
330 | 330 | ?> |
@@ -334,13 +334,13 @@ discard block |
||
334 | 334 | <div class="nav-links pager row"> |
335 | 335 | |
336 | 336 | <?php |
337 | - $previous_post = get_previous_post_link( '%link', '<div class="previous col-md-6"><p class="nav-links-description">'._x( 'Previous Post', 'Previous post link', 'lsx' ).'</p><h3>%title</h3></div>' ); |
|
338 | - $previous_post = str_replace('<a','<a',$previous_post); |
|
337 | + $previous_post = get_previous_post_link('%link', '<div class="previous col-md-6"><p class="nav-links-description">' . _x('Previous Post', 'Previous post link', 'lsx') . '</p><h3>%title</h3></div>'); |
|
338 | + $previous_post = str_replace('<a', '<a', $previous_post); |
|
339 | 339 | echo $previous_post; |
340 | 340 | ?> |
341 | 341 | <?php |
342 | - $next_post = get_next_post_link( '%link', '<div class="next col-md-6"><p class="nav-links-description">'._x( 'Next Post', 'Next post link', 'lsx' ).'</p><h3>%title</h3></div>' ); |
|
343 | - $next_post = str_replace('<a','<a',$next_post); |
|
342 | + $next_post = get_next_post_link('%link', '<div class="next col-md-6"><p class="nav-links-description">' . _x('Next Post', 'Next post link', 'lsx') . '</p><h3>%title</h3></div>'); |
|
343 | + $next_post = str_replace('<a', '<a', $next_post); |
|
344 | 344 | echo $next_post; |
345 | 345 | ?> |
346 | 346 | |
@@ -357,16 +357,16 @@ discard block |
||
357 | 357 | * @subpackage template-tags |
358 | 358 | * @category header |
359 | 359 | */ |
360 | -if(!function_exists('lsx_site_identity')){ |
|
361 | - function lsx_site_identity(){ |
|
360 | +if ( ! function_exists('lsx_site_identity')) { |
|
361 | + function lsx_site_identity() { |
|
362 | 362 | |
363 | - if ( function_exists('has_custom_logo') && has_custom_logo() ) { |
|
363 | + if (function_exists('has_custom_logo') && has_custom_logo()) { |
|
364 | 364 | the_custom_logo(); |
365 | - }elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { |
|
365 | + }elseif (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) { |
|
366 | 366 | jetpack_the_site_logo(); |
367 | - }else{ |
|
367 | + } else { |
|
368 | 368 | // shouldn't show both together.. its just strange |
369 | - if(true == get_theme_mod('site_logo_header_text',1)){ |
|
369 | + if (true == get_theme_mod('site_logo_header_text', 1)) { |
|
370 | 370 | lsx_site_title(); |
371 | 371 | } |
372 | 372 | } |
@@ -381,17 +381,17 @@ discard block |
||
381 | 381 | * @subpackage template-tags |
382 | 382 | * @category navigation |
383 | 383 | */ |
384 | -if(!function_exists('lsx_navbar_header')){ |
|
385 | - function lsx_navbar_header(){ ?> |
|
384 | +if ( ! function_exists('lsx_navbar_header')) { |
|
385 | + function lsx_navbar_header() { ?> |
|
386 | 386 | <div class="navbar-header" itemscope itemtype="http://schema.org/WebPage"> |
387 | 387 | |
388 | 388 | <?php |
389 | - $nav_menu = get_theme_mod('nav_menu_locations',false); |
|
389 | + $nav_menu = get_theme_mod('nav_menu_locations', false); |
|
390 | 390 | //print_r(get_nav_menu_locations()); |
391 | 391 | |
392 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
392 | + if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?> |
|
393 | 393 | <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".primary-navbar"> |
394 | - <span class="sr-only"><?php _e('Toggle navigation','lsx'); ?></span> |
|
394 | + <span class="sr-only"><?php _e('Toggle navigation', 'lsx'); ?></span> |
|
395 | 395 | <span class="icon-bar"></span> |
396 | 396 | <span class="icon-bar"></span> |
397 | 397 | <span class="icon-bar"></span> |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | <?php } |
404 | 404 | } |
405 | 405 | //the if statement is for backwards compatability with previous versions of the theme. |
406 | -add_action('lsx_nav_before','lsx_navbar_header'); |
|
406 | +add_action('lsx_nav_before', 'lsx_navbar_header'); |
|
407 | 407 | |
408 | 408 | /** |
409 | 409 | * Outputs the Nav Menu |
@@ -412,16 +412,16 @@ discard block |
||
412 | 412 | * @subpackage template-tags |
413 | 413 | * @category navigation |
414 | 414 | */ |
415 | -if(!function_exists('lsx_nav_menu')){ |
|
416 | - function lsx_nav_menu(){ |
|
417 | - $nav_menu = get_theme_mod('nav_menu_locations',false); |
|
415 | +if ( ! function_exists('lsx_nav_menu')) { |
|
416 | + function lsx_nav_menu() { |
|
417 | + $nav_menu = get_theme_mod('nav_menu_locations', false); |
|
418 | 418 | |
419 | 419 | //print_r(get_nav_menu_locations()); |
420 | 420 | |
421 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
421 | + if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?> |
|
422 | 422 | <nav class="primary-navbar collapse navbar-collapse"> |
423 | 423 | <?php |
424 | - wp_nav_menu( array( |
|
424 | + wp_nav_menu(array( |
|
425 | 425 | 'theme_location' => 'primary', |
426 | 426 | 'menu' => $nav_menu['primary'], |
427 | 427 | 'depth' => 3, |
@@ -431,9 +431,9 @@ discard block |
||
431 | 431 | ); |
432 | 432 | ?> |
433 | 433 | </nav> |
434 | - <?php } elseif(is_customize_preview()) { ?> |
|
434 | + <?php } elseif (is_customize_preview()) { ?> |
|
435 | 435 | <nav class="primary-navbar collapse navbar-collapse"> |
436 | - <div class="alert alert-info" role="alert"><?php _e('Create a menu and assign it here via the "Navigation" panel.','lsx');?></div> |
|
436 | + <div class="alert alert-info" role="alert"><?php _e('Create a menu and assign it here via the "Navigation" panel.', 'lsx'); ?></div> |
|
437 | 437 | </nav> |
438 | 438 | </div> |
439 | 439 | <?php } |
@@ -447,9 +447,9 @@ discard block |
||
447 | 447 | * @subpackage template-tags |
448 | 448 | * @category sitemap |
449 | 449 | */ |
450 | -function lsx_sitemap_pages(){ |
|
450 | +function lsx_sitemap_pages() { |
|
451 | 451 | $posts_per_page = get_option('posts_per_page'); |
452 | - if(false == $posts_per_page){ |
|
452 | + if (false == $posts_per_page) { |
|
453 | 453 | $posts_per_page = 10; |
454 | 454 | } |
455 | 455 | |
@@ -460,13 +460,13 @@ discard block |
||
460 | 460 | 'post_type' => 'page', |
461 | 461 | ); |
462 | 462 | $pages = new WP_Query($page_args); |
463 | - if($pages->have_posts()){ |
|
463 | + if ($pages->have_posts()) { |
|
464 | 464 | |
465 | - echo '<h2>'.__( 'Pages', 'lsx' ).'</h2>'; |
|
465 | + echo '<h2>' . __('Pages', 'lsx') . '</h2>'; |
|
466 | 466 | |
467 | 467 | echo '<ul>'; |
468 | - while($pages->have_posts()){ $pages->the_post(); |
|
469 | - echo '<li class="page_item page-item-'.get_the_ID().'"><a href="'.get_permalink().'" title="">'.get_the_title().'</a></li>'; |
|
468 | + while ($pages->have_posts()) { $pages->the_post(); |
|
469 | + echo '<li class="page_item page-item-' . get_the_ID() . '"><a href="' . get_permalink() . '" title="">' . get_the_title() . '</a></li>'; |
|
470 | 470 | } |
471 | 471 | echo '</ul>'; |
472 | 472 | |
@@ -481,10 +481,10 @@ discard block |
||
481 | 481 | * @subpackage template-tags |
482 | 482 | * @category sitemap |
483 | 483 | */ |
484 | -function lsx_sitemap_custom_post_type(){ |
|
484 | +function lsx_sitemap_custom_post_type() { |
|
485 | 485 | |
486 | 486 | $posts_per_page = get_option('posts_per_page'); |
487 | - if(false == $posts_per_page){ |
|
487 | + if (false == $posts_per_page) { |
|
488 | 488 | $posts_per_page = 10; |
489 | 489 | } |
490 | 490 | |
@@ -492,8 +492,8 @@ discard block |
||
492 | 492 | 'public' => true, |
493 | 493 | '_builtin' => false |
494 | 494 | ); |
495 | - $post_types = get_post_types($args , 'names'); |
|
496 | - foreach($post_types as $post_type){ |
|
495 | + $post_types = get_post_types($args, 'names'); |
|
496 | + foreach ($post_types as $post_type) { |
|
497 | 497 | |
498 | 498 | $post_type_args = array( |
499 | 499 | 'post_type' => 'page', |
@@ -504,19 +504,19 @@ discard block |
||
504 | 504 | $post_type_items = new WP_Query($post_type_args); |
505 | 505 | |
506 | 506 | $post_type_object = get_post_type_object($post_type); |
507 | - if(null != $post_type_object){ |
|
507 | + if (null != $post_type_object) { |
|
508 | 508 | $title = $post_type_object->labels->name; |
509 | - }else{ |
|
509 | + } else { |
|
510 | 510 | $title = ucwords($post_type); |
511 | 511 | } |
512 | 512 | |
513 | - if($post_type_items->have_posts()){ |
|
513 | + if ($post_type_items->have_posts()) { |
|
514 | 514 | |
515 | - printf( '<h2>'.__( '%1$s', 'lsx' ).'</h2>', $title ); |
|
515 | + printf('<h2>' . __('%1$s', 'lsx') . '</h2>', $title); |
|
516 | 516 | |
517 | 517 | echo '<ul>'; |
518 | - while($post_type_items->have_posts()){ $post_type_items->the_post(); |
|
519 | - echo '<li class="'.get_post_type().'_item '.get_post_type().'-item-'.get_the_ID().'"><a href="'.get_permalink().'" title="">'.get_the_title().'</a></li>'; |
|
518 | + while ($post_type_items->have_posts()) { $post_type_items->the_post(); |
|
519 | + echo '<li class="' . get_post_type() . '_item ' . get_post_type() . '-item-' . get_the_ID() . '"><a href="' . get_permalink() . '" title="">' . get_the_title() . '</a></li>'; |
|
520 | 520 | } |
521 | 521 | echo '</ul>'; |
522 | 522 | |
@@ -532,20 +532,20 @@ discard block |
||
532 | 532 | * @subpackage template-tags |
533 | 533 | * @category sitemap |
534 | 534 | */ |
535 | -function lsx_sitemap_taxonomy_clouds(){ |
|
535 | +function lsx_sitemap_taxonomy_clouds() { |
|
536 | 536 | |
537 | - $taxonomy_args = array( |
|
537 | + $taxonomy_args = array( |
|
538 | 538 | 'public' => true, |
539 | 539 | '_builtin' => false |
540 | 540 | ); |
541 | 541 | $taxonomies = get_taxonomies($taxonomy_args); |
542 | - if(!empty($taxonomies)){ |
|
543 | - foreach($taxonomies as $taxonomy_id => $taxonomy) { |
|
542 | + if ( ! empty($taxonomies)) { |
|
543 | + foreach ($taxonomies as $taxonomy_id => $taxonomy) { |
|
544 | 544 | |
545 | - $tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id,'echo'=>false)); |
|
546 | - if(null != $tag_cloud){ |
|
547 | - printf( '<h2>'.__( '%1$s', 'lsx' ).'</h2>', $taxonomy ); |
|
548 | - echo '<aside id="'.$taxonomy_id.'" class="widget widget_'.$taxonomy_id.'">'.$tag_cloud.'</aside>'; |
|
545 | + $tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id, 'echo'=>false)); |
|
546 | + if (null != $tag_cloud) { |
|
547 | + printf('<h2>' . __('%1$s', 'lsx') . '</h2>', $taxonomy); |
|
548 | + echo '<aside id="' . $taxonomy_id . '" class="widget widget_' . $taxonomy_id . '">' . $tag_cloud . '</aside>'; |
|
549 | 549 | } |
550 | 550 | } |
551 | 551 | } |
@@ -558,15 +558,15 @@ discard block |
||
558 | 558 | * @subpackage hooks |
559 | 559 | * @category forms |
560 | 560 | */ |
561 | -add_action( 'lsx_footer_before', 'lsx_footer_subscription_cta', 10 ); |
|
561 | +add_action('lsx_footer_before', 'lsx_footer_subscription_cta', 10); |
|
562 | 562 | function lsx_footer_subscription_cta() { |
563 | - if(!function_exists('lsx_is_form_enabled')){ return; } |
|
563 | + if ( ! function_exists('lsx_is_form_enabled')) { return; } |
|
564 | 564 | $subscribe_form_id = lsx_is_form_enabled('subscribe'); |
565 | - if(false == $subscribe_form_id) { return; } |
|
565 | + if (false == $subscribe_form_id) { return; } |
|
566 | 566 | |
567 | 567 | //add Caldera Forms Fields Scripts |
568 | - if( defined( 'CFCORE_VER' ) ){ |
|
569 | - wp_enqueue_script( 'cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER ); |
|
568 | + if (defined('CFCORE_VER')) { |
|
569 | + wp_enqueue_script('cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER); |
|
570 | 570 | } |
571 | 571 | |
572 | 572 | ?> |
@@ -574,8 +574,8 @@ discard block |
||
574 | 574 | <div class="container"> |
575 | 575 | <div class="row"> |
576 | 576 | <div class="col-md-12"> |
577 | - <h2><?php _e( 'Subscribe to Our Newsletter', 'lsx' ); ?></h2> |
|
578 | - <?php echo do_shortcode( '[caldera_form id="'.$subscribe_form_id.'"]' ); ?> |
|
577 | + <h2><?php _e('Subscribe to Our Newsletter', 'lsx'); ?></h2> |
|
578 | + <?php echo do_shortcode('[caldera_form id="' . $subscribe_form_id . '"]'); ?> |
|
579 | 579 | </div> |
580 | 580 | </div> |
581 | 581 | </div> |
@@ -590,14 +590,14 @@ discard block |
||
590 | 590 | * @subpackage hooks |
591 | 591 | * @category menu |
592 | 592 | */ |
593 | -add_action( 'lsx_header_top', 'lsx_add_top_menu' ); |
|
593 | +add_action('lsx_header_top', 'lsx_add_top_menu'); |
|
594 | 594 | function lsx_add_top_menu() { |
595 | 595 | if (has_nav_menu('top-menu')) { ?> |
596 | 596 | <div id="top-menu" class="<?php lsx_top_menu_classes(); ?>"> |
597 | 597 | <div class="container"> |
598 | 598 | <nav class="top-menu"> |
599 | 599 | <?php |
600 | - wp_nav_menu( array( |
|
600 | + wp_nav_menu(array( |
|
601 | 601 | 'theme_location' => 'top-menu', |
602 | 602 | 'walker' => new lsx_bootstrap_navwalker()) |
603 | 603 | ); |
@@ -615,24 +615,24 @@ discard block |
||
615 | 615 | * @subpackage template-tag |
616 | 616 | * @category forms |
617 | 617 | */ |
618 | -if ( class_exists('Caldera_Forms') && !function_exists( 'lsx_is_form_enabled' ) ) { |
|
618 | +if (class_exists('Caldera_Forms') && ! function_exists('lsx_is_form_enabled')) { |
|
619 | 619 | function lsx_is_form_enabled($slug = false) { |
620 | - if(false == $slug){ return false; } |
|
620 | + if (false == $slug) { return false; } |
|
621 | 621 | |
622 | 622 | $match = false; |
623 | - $forms = get_option( '_caldera_forms' , false ); |
|
624 | - if(false !== $forms ) { |
|
625 | - foreach($forms as $form_id=>$form_maybe){ |
|
626 | - if( trim(strtolower($slug)) == strtolower($form_maybe['name']) ){ |
|
623 | + $forms = get_option('_caldera_forms', false); |
|
624 | + if (false !== $forms) { |
|
625 | + foreach ($forms as $form_id=>$form_maybe) { |
|
626 | + if (trim(strtolower($slug)) == strtolower($form_maybe['name'])) { |
|
627 | 627 | $match = $form_id; |
628 | 628 | break; |
629 | 629 | } |
630 | 630 | } |
631 | 631 | } |
632 | - if( false === $match ){ |
|
633 | - $is_form = Caldera_Forms::get_form( strtolower( $slug ) ); |
|
634 | - if( !empty( $is_form ) ){ |
|
635 | - return strtolower( $slug ); |
|
632 | + if (false === $match) { |
|
633 | + $is_form = Caldera_Forms::get_form(strtolower($slug)); |
|
634 | + if ( ! empty($is_form)) { |
|
635 | + return strtolower($slug); |
|
636 | 636 | } |
637 | 637 | } |
638 | 638 | |
@@ -648,10 +648,10 @@ discard block |
||
648 | 648 | * @category urls |
649 | 649 | */ |
650 | 650 | function lsx_get_my_url() { |
651 | - if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) |
|
651 | + if ( ! preg_match('/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches)) |
|
652 | 652 | return false; |
653 | 653 | |
654 | - return esc_url_raw( $matches[1] ); |
|
654 | + return esc_url_raw($matches[1]); |
|
655 | 655 | } |
656 | 656 | |
657 | 657 | /** |
@@ -661,19 +661,19 @@ discard block |
||
661 | 661 | * @subpackage extras |
662 | 662 | * @category urls |
663 | 663 | */ |
664 | -function lsx_get_template_part($slug,$part) { |
|
664 | +function lsx_get_template_part($slug, $part) { |
|
665 | 665 | $template = array(); |
666 | 666 | $part = (string) $part; |
667 | - if ( '' !== $part ){ |
|
667 | + if ('' !== $part) { |
|
668 | 668 | $template = "{$slug}-{$part}.php"; |
669 | - }else{ |
|
669 | + } else { |
|
670 | 670 | $template = "{$slug}.php"; |
671 | 671 | } |
672 | - $file_path = apply_filters('lsx_content_path',false,$slug,$part); |
|
672 | + $file_path = apply_filters('lsx_content_path', false, $slug, $part); |
|
673 | 673 | |
674 | - if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) { |
|
675 | - load_template( $file_path.$template, false ); |
|
676 | - }else{ |
|
677 | - get_template_part($slug,$part); |
|
674 | + if (false !== $file_path && '' == locate_template(array($template)) && file_exists($file_path . $template)) { |
|
675 | + load_template($file_path . $template, false); |
|
676 | + } else { |
|
677 | + get_template_part($slug, $part); |
|
678 | 678 | } |
679 | 679 | } |
680 | 680 | \ No newline at end of file |
@@ -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,31 +89,31 @@ 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 | /** |
@@ -122,19 +122,19 @@ discard block |
||
122 | 122 | * $lsx_supports[] = 'entry'; |
123 | 123 | */ |
124 | 124 | function lsx_entry_before() { |
125 | - do_action( 'lsx_entry_before' ); |
|
125 | + do_action('lsx_entry_before'); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | function lsx_entry_after() { |
129 | - do_action( 'lsx_entry_after' ); |
|
129 | + do_action('lsx_entry_after'); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | function lsx_entry_top() { |
133 | - do_action( 'lsx_entry_top' ); |
|
133 | + do_action('lsx_entry_top'); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | function lsx_entry_bottom() { |
137 | - do_action( 'lsx_entry_bottom' ); |
|
137 | + do_action('lsx_entry_bottom'); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | * $lsx_supports[] = 'comments'; |
144 | 144 | */ |
145 | 145 | function lsx_comments_before() { |
146 | - do_action( 'lsx_comments_before' ); |
|
146 | + do_action('lsx_comments_before'); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | function lsx_comments_after() { |
150 | - do_action( 'lsx_comments_after' ); |
|
150 | + do_action('lsx_comments_after'); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -156,19 +156,19 @@ discard block |
||
156 | 156 | * $lsx_supports[] = 'sidebar'; |
157 | 157 | */ |
158 | 158 | function lsx_sidebars_before() { |
159 | - do_action( 'lsx_sidebars_before' ); |
|
159 | + do_action('lsx_sidebars_before'); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | function lsx_sidebars_after() { |
163 | - do_action( 'lsx_sidebars_after' ); |
|
163 | + do_action('lsx_sidebars_after'); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | function lsx_sidebar_top() { |
167 | - do_action( 'lsx_sidebar_top' ); |
|
167 | + do_action('lsx_sidebar_top'); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | function lsx_sidebar_bottom() { |
171 | - do_action( 'lsx_sidebar_bottom' ); |
|
171 | + do_action('lsx_sidebar_bottom'); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -177,17 +177,17 @@ discard block |
||
177 | 177 | * $lsx_supports[] = 'footer'; |
178 | 178 | */ |
179 | 179 | function lsx_footer_before() { |
180 | - do_action( 'lsx_footer_before' ); |
|
180 | + do_action('lsx_footer_before'); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | function lsx_footer_after() { |
184 | - do_action( 'lsx_footer_after' ); |
|
184 | + do_action('lsx_footer_after'); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | function lsx_footer_top() { |
188 | - do_action( 'lsx_footer_top' ); |
|
188 | + do_action('lsx_footer_top'); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | function lsx_footer_bottom() { |
192 | - do_action( 'lsx_footer_bottom' ); |
|
192 | + do_action('lsx_footer_bottom'); |
|
193 | 193 | } |
194 | 194 | \ No newline at end of file |