@@ -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 |
@@ -18,17 +18,17 @@ discard block |
||
18 | 18 | <div class="col-sm-12"> |
19 | 19 | <div class="entry-content"> |
20 | 20 | |
21 | - <?php if ( ! is_singular() ) { |
|
21 | + <?php if ( ! is_singular()) { |
|
22 | 22 | the_excerpt(); |
23 | 23 | } else { |
24 | 24 | the_content(); |
25 | 25 | |
26 | - wp_link_pages( array( |
|
26 | + wp_link_pages(array( |
|
27 | 27 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
28 | 28 | 'after' => '</div></div>', |
29 | 29 | 'link_before' => '<span>', |
30 | 30 | 'link_after' => '</span>' |
31 | - ) ); |
|
31 | + )); |
|
32 | 32 | } ?> |
33 | 33 | |
34 | 34 | <?php lsx_portfolio_gallery(); ?> |
@@ -36,16 +36,16 @@ discard block |
||
36 | 36 | <?php lsx_post_nav(); ?> |
37 | 37 | |
38 | 38 | <?php |
39 | - if ( class_exists( 'LSX_Sharing' ) ) { |
|
39 | + if (class_exists('LSX_Sharing')) { |
|
40 | 40 | lsx_content_sharing(); |
41 | 41 | } else { |
42 | - if ( function_exists( 'sharing_display' ) ) { |
|
43 | - sharing_display( '', true ); |
|
42 | + if (function_exists('sharing_display')) { |
|
43 | + sharing_display('', true); |
|
44 | 44 | } |
45 | 45 | |
46 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
46 | + if (class_exists('Jetpack_Likes')) { |
|
47 | 47 | $custom_likes = new Jetpack_Likes; |
48 | - echo wp_kses_post( $custom_likes->post_likes( '' ) ); |
|
48 | + echo wp_kses_post($custom_likes->post_likes('')); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | ?> |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | </div> |
58 | 58 | </div> |
59 | 59 | |
60 | - <?php edit_post_link( esc_html__( 'Edit', 'lsx' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?> |
|
60 | + <?php edit_post_link(esc_html__('Edit', 'lsx'), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>'); ?> |
|
61 | 61 | |
62 | 62 | <?php lsx_entry_bottom(); ?> |
63 | 63 |