Completed
Push — master ( 386a32...8f5969 )
by Fernando
02:29
created
functions.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
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.0');
10 10
 
@@ -19,22 +19,22 @@  discard block
 block discarded – undo
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
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
  * @category	customizer
47 47
  * @return		$lsx_controls array()
48 48
  */
49
-function lsx_customizer_core_controls( $lsx_controls ) {
49
+function lsx_customizer_core_controls($lsx_controls) {
50 50
 	$lsx_controls['sections']['lsx-core'] = array(
51
-		'title'       =>  esc_html__( 'Core Settings', 'lsx' ),
52
-		'description' => esc_html__( 'Change the core settings.', 'lsx' ),
51
+		'title'       =>  esc_html__('Core Settings', 'lsx'),
52
+		'description' => esc_html__('Change the core settings.', 'lsx'),
53 53
 		'priority'    => 21
54 54
 	);
55 55
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	);
61 61
 
62 62
 	$lsx_controls['fields']['lsx_lazyload_status'] = array(
63
-		'label'         =>  esc_html__( 'Lazy Loading Images', 'lsx' ),
63
+		'label'         =>  esc_html__('Lazy Loading Images', 'lsx'),
64 64
 		'section'       =>  'lsx-core',
65 65
 		'type'          =>  'checkbox',
66 66
 	);
@@ -72,14 +72,14 @@  discard block
 block discarded – undo
72 72
 	);
73 73
 
74 74
 	$lsx_controls['fields']['lsx_preloader_content_status'] = array(
75
-		'label'         =>  esc_html__( 'Preloader Content', 'lsx' ),
75
+		'label'         =>  esc_html__('Preloader Content', 'lsx'),
76 76
 		'section'       =>  'lsx-core',
77 77
 		'type'          =>  'checkbox',
78 78
 	);
79 79
 
80 80
 	return $lsx_controls;
81 81
 }
82
-add_filter( 'lsx_customizer_controls', 'lsx_customizer_core_controls' );
82
+add_filter('lsx_customizer_controls', 'lsx_customizer_core_controls');
83 83
 
84 84
 /**
85 85
  * Returns an array of the layout panel.
@@ -90,56 +90,56 @@  discard block
 block discarded – undo
90 90
  * @return		$lsx_controls array()
91 91
  */
92 92
 function lsx_customizer_layout_controls($lsx_controls) {
93
-	$lsx_controls['settings']['lsx_header_layout']  = array(
93
+	$lsx_controls['settings']['lsx_header_layout'] = array(
94 94
 			'default'       =>  'inline', //Default setting/value to save
95 95
 			'type'        =>  'theme_mod', //Is this an 'option' or a 'theme_mod'?
96 96
 			'transport'     =>  'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
97 97
 	);
98 98
 	$lsx_controls['fields']['lsx_header_layout'] = array(
99
-			'label'         =>  esc_html__('Header','lsx'),
99
+			'label'         =>  esc_html__('Header', 'lsx'),
100 100
 			'section'       =>  'lsx-layout',
101 101
 			'control'   =>  'LSX_Customize_Header_Layout_Control',
102
-			'choices'		=>	array('central','expanded','inline')
102
+			'choices'		=>	array('central', 'expanded', 'inline')
103 103
 	);	
104 104
 	$lsx_controls['sections']['lsx-layout'] = array(
105
-			'title'       =>  esc_html__( 'Layout', 'lsx' ),
106
-			'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' ),
105
+			'title'       =>  esc_html__('Layout', 'lsx'),
106
+			'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'),
107 107
 			'priority' => 22
108 108
 	);
109
-	$lsx_controls['settings']['lsx_layout']  = array(
109
+	$lsx_controls['settings']['lsx_layout'] = array(
110 110
 			'default'       =>  '2cr', //Default setting/value to save
111 111
 			'type'        =>  'theme_mod', //Is this an 'option' or a 'theme_mod'?
112 112
 			'transport'     =>  'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
113 113
 	);
114
-	$lsx_controls['settings']['lsx_header_fixed']  = array(
114
+	$lsx_controls['settings']['lsx_header_fixed'] = array(
115 115
 			'default'       =>  false, //Default setting/value to save
116 116
 			'sanitize_callback' => 'lsx_sanitize_checkbox',
117 117
 			'transport'     =>  'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
118 118
 	);
119 119
 	$lsx_controls['fields']['lsx_header_fixed'] = array(
120
-			'label'         =>  esc_html__('Fixed Header','lsx'),
120
+			'label'         =>  esc_html__('Fixed Header', 'lsx'),
121 121
 			'section'       =>  'lsx-layout',
122 122
 			'type'       =>  'checkbox',
123 123
 	);
124
-	$lsx_controls['settings']['lsx_header_search']  = array(
124
+	$lsx_controls['settings']['lsx_header_search'] = array(
125 125
 			'default'       =>  false, //Default setting/value to save
126 126
 			'sanitize_callback' => 'lsx_sanitize_checkbox',
127 127
 			'transport'     =>  'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
128 128
 	);
129 129
 	$lsx_controls['fields']['lsx_header_search'] = array(
130
-			'label'         =>  esc_html__('Search Box in Header','lsx'),
130
+			'label'         =>  esc_html__('Search Box in Header', 'lsx'),
131 131
 			'section'       =>  'lsx-layout',
132 132
 			'type'       =>  'checkbox',
133 133
 	);	
134 134
 	$lsx_controls['fields']['lsx_layout'] = array(
135
-			'label'         =>  esc_html__('Body','lsx'),
135
+			'label'         =>  esc_html__('Body', 'lsx'),
136 136
 			'section'       =>  'lsx-layout',
137 137
 			'control'   =>  'LSX_Customize_Layout_Control',
138
-			'choices'		=>	array('1c','2cr','2cl')
138
+			'choices'		=>	array('1c', '2cr', '2cl')
139 139
 	);	
140 140
 	return $lsx_controls;
141 141
 }
142
-add_filter('lsx_customizer_controls','lsx_customizer_layout_controls');
142
+add_filter('lsx_customizer_controls', 'lsx_customizer_layout_controls');
143 143
 
144 144
 /**
145 145
  * Returns an array of the font controls.
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
  */
152 152
 function lsx_customizer_font_controls($lsx_controls) {
153 153
 	$lsx_controls['sections']['lsx-font'] = array(
154
-			'title'       =>  esc_html__( 'Font', 'lsx' ),
154
+			'title'       =>  esc_html__('Font', 'lsx'),
155 155
 			'description' => 'Change the fonts sitewide.',
156 156
 			'priority' => 41
157 157
 	);
158
-	$lsx_controls['settings']['lsx_font']  = array(
158
+	$lsx_controls['settings']['lsx_font'] = array(
159 159
 			'default'       =>  'raleway_open_sans', //Default setting/value to save
160 160
 			'type'        =>  'theme_mod', //Is this an 'option' or a 'theme_mod'?
161 161
 			'transport'     =>  'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)?
@@ -169,13 +169,13 @@  discard block
 block discarded – undo
169 169
 			'choices'   =>  array(
170 170
 					'raleway_open_sans' => array(
171 171
 							'header'  => array(
172
-									"title" => esc_html__( 'Raleway', 'lsx' ),
172
+									"title" => esc_html__('Raleway', 'lsx'),
173 173
 									"location" => "Raleway",
174 174
 									"cssDeclaration" => "'Raleway', sans-serif",
175 175
 									"cssClass" => "raleway",
176 176
 							),
177 177
 							'body'  => array(
178
-									"title" => esc_html__( 'Open Sans', 'lsx' ),
178
+									"title" => esc_html__('Open Sans', 'lsx'),
179 179
 									"location" => "Open+Sans",
180 180
 									"cssDeclaration" => "'Open Sans', sans-serif",
181 181
 									"cssClass" => "openSans"
@@ -183,13 +183,13 @@  discard block
 block discarded – undo
183 183
 					),
184 184
 					'noto_serif_noto_sans' => array(
185 185
 							'header'  => array(
186
-									"title" => esc_html__( 'Noto Serif', 'lsx' ),
186
+									"title" => esc_html__('Noto Serif', 'lsx'),
187 187
 									"location" => "Noto+Serif",
188 188
 									"cssDeclaration" => "'Noto Serif', serif",
189 189
 									"cssClass" => "notoSerif",
190 190
 							),
191 191
 							'body'  => array(
192
-									"title" => esc_html__( 'Noto Sans', 'lsx' ),
192
+									"title" => esc_html__('Noto Sans', 'lsx'),
193 193
 									"location" => "Noto+Sans",
194 194
 									"cssDeclaration" => "'Noto Sans', sans-serif",
195 195
 									"cssClass" => "notoSans",
@@ -197,13 +197,13 @@  discard block
 block discarded – undo
197 197
 					),
198 198
 					'noto_sans_noto_sans' => array(
199 199
 					'header'  => array(
200
-					"title" => esc_html__( 'Noto Sans', 'lsx' ),
200
+					"title" => esc_html__('Noto Sans', 'lsx'),
201 201
 					"location" => "Noto+Sans",
202 202
 					"cssDeclaration" => "'Noto Sans', sans-serif",
203 203
 					"cssClass" => "notoSans",
204 204
 					),
205 205
 					'body'  => array(
206
-					"title" => esc_html__( 'Noto Sans', 'lsx' ),
206
+					"title" => esc_html__('Noto Sans', 'lsx'),
207 207
 					"location" => "Noto+Sans",
208 208
 					"cssDeclaration" => "'Noto Sans', sans-serif",
209 209
 					"cssClass" => "notoSans",
@@ -211,13 +211,13 @@  discard block
 block discarded – undo
211 211
 					),
212 212
 					'alegreya_open_sans' => array(
213 213
 					'header'  => array(
214
-					"title" => esc_html__( 'Alegreya', 'lsx' ),
214
+					"title" => esc_html__('Alegreya', 'lsx'),
215 215
 					"location" => "Alegreya",
216 216
 					"cssDeclaration" => "'Alegreya', serif",
217 217
 					"cssClass" => "alegreya",
218 218
 					),
219 219
 					'body'  => array(
220
-					"title" => esc_html__( 'Open Sans', 'lsx' ),
220
+					"title" => esc_html__('Open Sans', 'lsx'),
221 221
 					"location" => "Open+Sans",
222 222
 					"cssDeclaration" => "'Open Sans', sans-serif",
223 223
 					"cssClass" => "openSans"
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	);	
229 229
 	return $lsx_controls;
230 230
 }
231
-add_filter('lsx_customizer_controls','lsx_customizer_font_controls');
231
+add_filter('lsx_customizer_controls', 'lsx_customizer_font_controls');
232 232
 
233 233
 /**
234 234
  * Returns an array of $controls for the customizer class to generate.
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
  * @category	customizer
239 239
  * @return		$lsx_controls array()
240 240
  */
241
-function lsx_get_customizer_controls(){
241
+function lsx_get_customizer_controls() {
242 242
 	$lsx_controls = array();
243 243
 	$lsx_controls = apply_filters('lsx_customizer_controls', $lsx_controls);
244 244
 	return $lsx_controls;
245 245
 }
246
-$lsx_customizer = new LSX_Theme_Customizer( lsx_get_customizer_controls() );
246
+$lsx_customizer = new LSX_Theme_Customizer(lsx_get_customizer_controls());
247 247
 
248
-add_image_size( 'lsx-thumbnail-wide', 350, 230, true );
249
-add_image_size( 'lsx-thumbnail-single', 750, 350, true );
250 248
\ No newline at end of file
249
+add_image_size('lsx-thumbnail-wide', 350, 230, true);
250
+add_image_size('lsx-thumbnail-single', 750, 350, true);
251 251
\ No newline at end of file
Please login to merge, or discard this patch.
inc/template-tags.php 1 patch
Spacing   +162 added lines, -162 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 = '\&raquo\;';
30 30
 	  	
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,83 +99,83 @@  discard block
 block discarded – undo
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
-		printf( '<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>',
128
-			esc_html_x( 'Posted by:', 'Used before post author name.', 'lsx' ),
129
-			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
127
+		printf('<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>',
128
+			esc_html_x('Posted by:', 'Used before post author name.', 'lsx'),
129
+			esc_url(get_author_posts_url(get_the_author_meta('ID'))),
130 130
 			get_the_author()
131 131
 		);
132 132
 	}
133 133
 }
134
-add_action( 'lsx_content_post_meta', 'lsx_post_meta_author', 20 );
134
+add_action('lsx_content_post_meta', 'lsx_post_meta_author', 20);
135 135
 
136 136
 /**
137 137
  * Add customisable post meta: post category(ies)
138 138
  */
139
-if ( ! function_exists( 'lsx_post_meta_category' ) ) {
139
+if ( ! function_exists('lsx_post_meta_category')) {
140 140
 	function lsx_post_meta_category() {
141
-		$post_categories = wp_get_post_categories( get_the_ID() );
141
+		$post_categories = wp_get_post_categories(get_the_ID());
142 142
 		$cats = array();
143 143
 
144
-		foreach( $post_categories as $c ) {
145
-			$cat = get_category( $c );
146
-			$cats[] = '<a href="' . get_category_link( $cat->term_id ) . '" title="' . sprintf( esc_html__( 'View all posts in %s' , 'lsx' ), $cat->name ) . '" ' . '>' . $cat->name . '</a>';
144
+		foreach ($post_categories as $c) {
145
+			$cat = get_category($c);
146
+			$cats[] = '<a href="' . get_category_link($cat->term_id) . '" title="' . sprintf(esc_html__('View all posts in %s', 'lsx'), $cat->name) . '" ' . '>' . $cat->name . '</a>';
147 147
 		}
148 148
 
149
-		if ( ! empty( $cats ) ) {
149
+		if ( ! empty($cats)) {
150 150
 			?>
151
-			<span class="post-meta-categories"><span><?php esc_html_e( 'Posted in:', 'lsx' ); ?></span> <?php echo wp_kses_post( implode( ', ', $cats ) ); ?></span>
151
+			<span class="post-meta-categories"><span><?php esc_html_e('Posted in:', 'lsx'); ?></span> <?php echo wp_kses_post(implode(', ', $cats)); ?></span>
152 152
 			<?php
153 153
 		}
154 154
 	}
155 155
 }
156
-add_action( 'lsx_content_post_meta', 'lsx_post_meta_category', 30 );
156
+add_action('lsx_content_post_meta', 'lsx_post_meta_category', 30);
157 157
 
158 158
 /**
159 159
  * Add customisable post meta: post tag(s)
160 160
  */
161
-if ( ! function_exists( 'lsx_post_tags' ) ) {
161
+if ( ! function_exists('lsx_post_tags')) {
162 162
 	function lsx_post_tags() {
163
-		if ( has_tag() ) :
163
+		if (has_tag()) :
164 164
 			?>
165 165
 			<div class="post-tags">
166
-				<span><?php esc_html_e( 'Tagged as:', 'lsx' ); ?></span> <?php echo wp_kses_post( get_the_tag_list( '' ) ); ?>
166
+				<span><?php esc_html_e('Tagged as:', 'lsx'); ?></span> <?php echo wp_kses_post(get_the_tag_list('')); ?>
167 167
 			</div>
168 168
 			<?php
169 169
 		endif;
170 170
 	}
171 171
 }
172
-add_action( 'lsx_content_post_tags', 'lsx_post_tags', 10 );
172
+add_action('lsx_content_post_tags', 'lsx_post_tags', 10);
173 173
 
174 174
 /**
175 175
  * Add customisable post info: related posts
176 176
  */
177 177
 function lsx_related_posts() {
178
-	if ( is_singular( 'post' ) && class_exists( 'Jetpack_RelatedPosts' ) ) {
178
+	if (is_singular('post') && class_exists('Jetpack_RelatedPosts')) {
179 179
 		?>
180 180
 			<div class="row row-related-posts">
181 181
 				<div class="col-md-12">
@@ -185,15 +185,15 @@  discard block
 block discarded – undo
185 185
 		<?php
186 186
 	}
187 187
 }
188
-add_action( 'lsx_entry_bottom', 'lsx_related_posts', 10 );
188
+add_action('lsx_entry_bottom', 'lsx_related_posts', 10);
189 189
 
190 190
 /**
191 191
  * Translate post format to Font Awesome class
192 192
  */
193 193
 
194
-if ( ! function_exists( 'lsx_translate_format_to_fontawesome' ) ) {
195
-	function lsx_translate_format_to_fontawesome( $format ) {
196
-		switch ( $format ) {
194
+if ( ! function_exists('lsx_translate_format_to_fontawesome')) {
195
+	function lsx_translate_format_to_fontawesome($format) {
196
+		switch ($format) {
197 197
 			case 'image':
198 198
 				$format = 'camera';
199 199
 				break;
@@ -238,45 +238,45 @@  discard block
 block discarded – undo
238 238
  * to be added/modified where necessary.
239 239
  */
240 240
 
241
-if ( ! function_exists( 'lsx_portfolio_meta' ) ) {
241
+if ( ! function_exists('lsx_portfolio_meta')) {
242 242
 	function lsx_portfolio_meta() {
243 243
 		?>
244 244
 		<div id="portfolio-meta" class="portfolio-meta info-box-sticky info-box sticky-wrapper">
245 245
 			<?php 
246
-				$client = get_post_meta(get_the_ID(),'lsx-client',true);
247
-				if(false != $client){ ?>
246
+				$client = get_post_meta(get_the_ID(), 'lsx-client', true);
247
+				if (false != $client) { ?>
248 248
 					<div class="portfolio-client">
249
-						<span><span class="fa fa-user"></span><?php esc_html_e( 'Client','lsx' ); ?></span>
250
-						<span><?php echo esc_html( $client ); ?></span>
249
+						<span><span class="fa fa-user"></span><?php esc_html_e('Client', 'lsx'); ?></span>
250
+						<span><?php echo esc_html($client); ?></span>
251 251
 					</div>				
252 252
 			<?php }	?>
253 253
 
254 254
 			<?php 
255
-				$portfolio_type = get_the_term_list( get_the_ID(), 'jetpack-portfolio-type', '', ', ', '' );
255
+				$portfolio_type = get_the_term_list(get_the_ID(), 'jetpack-portfolio-type', '', ', ', '');
256 256
 				
257
-				if($portfolio_type){
257
+				if ($portfolio_type) {
258 258
 					?>
259 259
 					<div class="portfolio-industry">
260
-						<span><span class="fa fa-folder-open"></span><?php esc_html_e( 'Industry', 'lsx' ); ?></span>
261
-						<?php echo wp_kses_post( $portfolio_type ); ?>
260
+						<span><span class="fa fa-folder-open"></span><?php esc_html_e('Industry', 'lsx'); ?></span>
261
+						<?php echo wp_kses_post($portfolio_type); ?>
262 262
 					</div>			
263 263
 			<?php } ?>
264 264
 
265 265
 			<?php 
266
-				$services = get_the_term_list( get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '' );
267
-				if(false != $services){ ?>
266
+				$services = get_the_term_list(get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '');
267
+				if (false != $services) { ?>
268 268
 					<div class="portfolio-services">
269
-						<span><span class="fa fa-cog"></span><?php esc_html_e( 'Services', 'lsx' ); ?></span>
270
-						<?php echo wp_kses_post( $services ); ?>
269
+						<span><span class="fa fa-cog"></span><?php esc_html_e('Services', 'lsx'); ?></span>
270
+						<?php echo wp_kses_post($services); ?>
271 271
 					</div>				
272 272
 			<?php }	?>
273 273
 
274 274
 			<?php 
275
-				$website = esc_url( get_post_meta(get_the_ID(),'lsx-website',true) );
276
-				if(false != $website){ ?>
275
+				$website = esc_url(get_post_meta(get_the_ID(), 'lsx-website', true));
276
+				if (false != $website) { ?>
277 277
 					<div class="portfolio-website">
278
-						<span><span class="fa fa-link"></span><?php esc_html_e( 'Website', 'lsx' ); ?></span>
279
-						<a target="_blank" href="<?php echo esc_url( $website ); ?>"><?php echo esc_html( $website ) ?></a>
278
+						<span><span class="fa fa-link"></span><?php esc_html_e('Website', 'lsx'); ?></span>
279
+						<a target="_blank" href="<?php echo esc_url($website); ?>"><?php echo esc_html($website) ?></a>
280 280
 					</div>				
281 281
 			<?php }	?>
282 282
 
@@ -290,29 +290,29 @@  discard block
 block discarded – undo
290 290
  *
291 291
  */
292 292
 
293
-if ( ! function_exists( 'lsx_portfolio_gallery' ) ) {
293
+if ( ! function_exists('lsx_portfolio_gallery')) {
294 294
 	function lsx_portfolio_gallery() {
295 295
 
296
-		$media = get_attached_media( 'image' );
296
+		$media = get_attached_media('image');
297 297
 		$media_array = array();
298 298
 		$post_thumbnail_id = get_post_thumbnail_id(get_the_ID());
299 299
 		
300
-		if(!empty($media)){
301
-			foreach($media as $media_item){
302
-				if($post_thumbnail_id != $media_item->ID) {
300
+		if ( ! empty($media)) {
301
+			foreach ($media as $media_item) {
302
+				if ($post_thumbnail_id != $media_item->ID) {
303 303
 					$media_array[] = $media_item->ID;
304 304
 				}
305 305
 			}
306 306
 				
307
-			if(!empty($media_array)){
308
-				echo wp_kses_post( gallery_shortcode( array( 'size' => 'full', 'ids' => implode( ',', $media_array ) ) ) );
307
+			if ( ! empty($media_array)) {
308
+				echo wp_kses_post(gallery_shortcode(array('size' => 'full', 'ids' => implode(',', $media_array))));
309 309
 			}
310 310
 		}
311 311
 		
312 312
 	}
313 313
 }
314 314
 
315
-if ( ! function_exists( 'lsx_paging_nav' ) ) :
315
+if ( ! function_exists('lsx_paging_nav')) :
316 316
 	/**
317 317
 	 * Display navigation to next/previous set of posts when applicable.
318 318
 	 *
@@ -320,33 +320,33 @@  discard block
 block discarded – undo
320 320
 	 */
321 321
 	function lsx_paging_nav() {
322 322
 		// Don't print empty markup if there's only one page.
323
-		if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
323
+		if ($GLOBALS['wp_query']->max_num_pages < 2) {
324 324
 			return;
325 325
 		}
326 326
 		
327
-		if(current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')){
327
+		if (current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')) {
328 328
 			return true;
329
-		}elseif(function_exists('wp_pagenavi')){
329
+		}elseif (function_exists('wp_pagenavi')) {
330 330
 			wp_pagenavi();
331
-		}else{
331
+		} else {
332 332
 			
333 333
 			$labels = array(
334
-				'next' 		=> '<span class="meta-nav">&larr;</span> '.esc_html__( 'Older posts', 'lsx' ),
335
-				'previous' 	=> esc_html__( 'Newer posts', 'lsx' ).' <span class="meta-nav">&rarr;</span>',
336
-				'title' 	=> esc_html__( 'Posts navigation', 'lsx' )
334
+				'next' 		=> '<span class="meta-nav">&larr;</span> ' . esc_html__('Older posts', 'lsx'),
335
+				'previous' 	=> esc_html__('Newer posts', 'lsx') . ' <span class="meta-nav">&rarr;</span>',
336
+				'title' 	=> esc_html__('Posts navigation', 'lsx')
337 337
 			);
338
-			$labels = apply_filters('lsx_post_navigation_labels',$labels);
338
+			$labels = apply_filters('lsx_post_navigation_labels', $labels);
339 339
 			?>
340 340
 			<nav class="navigation paging-navigation" role="navigation">
341 341
 				<div class="lsx-breaker"></div>
342
-				<h1 class="screen-reader-text"><?php echo esc_html( $labels['title'] ); ?></h1>
342
+				<h1 class="screen-reader-text"><?php echo esc_html($labels['title']); ?></h1>
343 343
 				<div class="nav-links">
344
-					<?php if ( get_next_posts_link() ) : ?>
345
-					<div class="nav-previous"><?php next_posts_link( $labels['next'] ); ?></div>
344
+					<?php if (get_next_posts_link()) : ?>
345
+					<div class="nav-previous"><?php next_posts_link($labels['next']); ?></div>
346 346
 					<?php endif; ?>
347 347
 		
348
-					<?php if ( get_previous_posts_link() ) : ?>
349
-					<div class="nav-next"><?php previous_posts_link( $labels['previous'] ); ?></div>
348
+					<?php if (get_previous_posts_link()) : ?>
349
+					<div class="nav-next"><?php previous_posts_link($labels['previous']); ?></div>
350 350
 					<?php endif; ?>
351 351
 					
352 352
 					<div class="clearfix"></div>
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 	}
358 358
 endif;
359 359
 
360
-if ( ! function_exists( 'lsx_post_nav' ) ) :
360
+if ( ! function_exists('lsx_post_nav')) :
361 361
 /**
362 362
  * Display navigation to next/previous post when applicable.
363 363
  *
@@ -365,10 +365,10 @@  discard block
 block discarded – undo
365 365
  */
366 366
 function lsx_post_nav() {
367 367
 	// Don't print empty markup if there's nowhere to navigate.
368
-	$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
369
-	$next     = get_adjacent_post( false, '', false );
368
+	$previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true);
369
+	$next     = get_adjacent_post(false, '', false);
370 370
 
371
-	if ( ! $next && ! $previous ) {
371
+	if ( ! $next && ! $previous) {
372 372
 		return;
373 373
 	}
374 374
 	?>
@@ -378,14 +378,14 @@  discard block
 block discarded – undo
378 378
 		<div class="nav-links pager row">
379 379
 
380 380
 			<?php
381
-				$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>' );
382
-				$previous_post = str_replace('<a','<a',$previous_post);
383
-				echo wp_kses_post( $previous_post );
381
+				$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>');
382
+				$previous_post = str_replace('<a', '<a', $previous_post);
383
+				echo wp_kses_post($previous_post);
384 384
 			?>
385 385
 			<?php
386
-				$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>' );
387
-				$next_post = str_replace('<a','<a',$next_post);
388
-				echo wp_kses_post( $next_post );
386
+				$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>');
387
+				$next_post = str_replace('<a', '<a', $next_post);
388
+				echo wp_kses_post($next_post);
389 389
 			?>
390 390
 
391 391
 		</div><!-- .nav-links -->
@@ -401,16 +401,16 @@  discard block
 block discarded – undo
401 401
  * @subpackage	template-tags
402 402
  * @category	header
403 403
  */
404
-if(!function_exists('lsx_site_identity')){
405
-	function lsx_site_identity(){
404
+if ( ! function_exists('lsx_site_identity')) {
405
+	function lsx_site_identity() {
406 406
 
407
-		if ( function_exists('has_custom_logo') && has_custom_logo() ) {
407
+		if (function_exists('has_custom_logo') && has_custom_logo()) {
408 408
 			the_custom_logo();
409
-		}elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) {
409
+		}elseif (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) {
410 410
 			jetpack_the_site_logo();
411
-		}else{
411
+		} else {
412 412
 			// shouldn't show both together.. its just strange
413
-			if(true == get_theme_mod('site_logo_header_text',1)){
413
+			if (true == get_theme_mod('site_logo_header_text', 1)) {
414 414
 				lsx_site_title();
415 415
 			}
416 416
 		}
@@ -425,29 +425,29 @@  discard block
 block discarded – undo
425 425
  * @subpackage	template-tags
426 426
  * @category	navigation
427 427
  */
428
-if(!function_exists('lsx_navbar_header')){
429
-	function lsx_navbar_header(){ ?>
428
+if ( ! function_exists('lsx_navbar_header')) {
429
+	function lsx_navbar_header() { ?>
430 430
 	   	<div class="navbar-header" itemscope itemtype="http://schema.org/WebPage">
431 431
 	   	
432 432
 	   		<?php 
433
-	   		$nav_menu = get_theme_mod('nav_menu_locations',false);
433
+	   		$nav_menu = get_theme_mod('nav_menu_locations', false);
434 434
 			//print_r(get_nav_menu_locations());
435 435
 
436
-	   		if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?>
436
+	   		if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?>
437 437
 		   		<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".primary-navbar">
438
-		        	<span class="sr-only"><?php esc_html_e( 'Toggle navigation', 'lsx' ); ?></span>
438
+		        	<span class="sr-only"><?php esc_html_e('Toggle navigation', 'lsx'); ?></span>
439 439
 		        	<span class="icon-bar"></span>
440 440
 		        	<span class="icon-bar"></span>
441 441
 		        	<span class="icon-bar"></span>
442 442
 		   		</button>
443
-	   			<span class="mobile-menu-title"><?php esc_html_e( 'Menu', 'lsx' ); ?></span>
443
+	   			<span class="mobile-menu-title"><?php esc_html_e('Menu', 'lsx'); ?></span>
444 444
 	   		<?php } ?>
445 445
 			<?php lsx_site_identity(); ?>
446 446
 	    </div>
447 447
 	<?php }
448 448
 }
449 449
 //the if statement is for backwards compatability with previous versions of the theme.
450
-add_action('lsx_nav_before','lsx_navbar_header');
450
+add_action('lsx_nav_before', 'lsx_navbar_header');
451 451
 
452 452
 /**
453 453
  * Outputs the Nav Menu
@@ -456,16 +456,16 @@  discard block
 block discarded – undo
456 456
  * @subpackage	template-tags
457 457
  * @category	navigation
458 458
  */
459
-if(!function_exists('lsx_nav_menu')){
460
-	function lsx_nav_menu(){
461
-		$nav_menu = get_theme_mod('nav_menu_locations',false);
459
+if ( ! function_exists('lsx_nav_menu')) {
460
+	function lsx_nav_menu() {
461
+		$nav_menu = get_theme_mod('nav_menu_locations', false);
462 462
 		
463 463
 		//print_r(get_nav_menu_locations());
464 464
 
465
-	    if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?>
465
+	    if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?>
466 466
 			<nav class="primary-navbar collapse navbar-collapse">
467 467
 		    	<?php
468
-				wp_nav_menu( array(
468
+				wp_nav_menu(array(
469 469
 					'theme_location' => 'primary',
470 470
 					'menu' => $nav_menu['primary'],
471 471
 					'depth' => 3,
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
  * @subpackage	template-tags
487 487
  * @category	sitemap
488 488
  */
489
-function lsx_sitemap_pages(){
489
+function lsx_sitemap_pages() {
490 490
 	$page_args = array(
491 491
 		'post_type'		=>	'page',
492 492
 		'posts_per_page'=>	99,
@@ -494,13 +494,13 @@  discard block
 block discarded – undo
494 494
 		'post_type'		=>	'page',
495 495
 	);
496 496
 	$pages = new WP_Query($page_args);
497
-	if($pages->have_posts()){
497
+	if ($pages->have_posts()) {
498 498
 
499
-		echo '<h2>' . esc_html__( 'Pages', 'lsx' ) . '</h2>';
499
+		echo '<h2>' . esc_html__('Pages', 'lsx') . '</h2>';
500 500
 
501 501
 		echo '<ul>';
502
-		while($pages->have_posts()){ $pages->the_post();
503
-			echo '<li class="page_item page-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>';
502
+		while ($pages->have_posts()) { $pages->the_post();
503
+			echo '<li class="page_item page-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>';
504 504
 		}
505 505
 		echo '</ul>';
506 506
 		
@@ -515,13 +515,13 @@  discard block
 block discarded – undo
515 515
  * @subpackage	template-tags
516 516
  * @category	sitemap
517 517
  */
518
-function lsx_sitemap_custom_post_type(){
518
+function lsx_sitemap_custom_post_type() {
519 519
 	$args = array(
520 520
 		'public'				=> true,
521 521
 		'_builtin' 				=> false
522 522
 	);
523
-	$post_types = get_post_types($args , 'names');
524
-	foreach($post_types as $post_type){	
523
+	$post_types = get_post_types($args, 'names');
524
+	foreach ($post_types as $post_type) {	
525 525
 
526 526
 		$post_type_args = array(
527 527
 			'post_type'		=>	'page',
@@ -532,19 +532,19 @@  discard block
 block discarded – undo
532 532
 		$post_type_items = new WP_Query($post_type_args);
533 533
 		
534 534
 		$post_type_object = get_post_type_object($post_type);
535
-		if(null != $post_type_object){
535
+		if (null != $post_type_object) {
536 536
 			$title = $post_type_object->labels->name;
537
-		}else{
537
+		} else {
538 538
 			$title = ucwords($post_type);
539 539
 		}
540 540
 		
541
-		if($post_type_items->have_posts()){
541
+		if ($post_type_items->have_posts()) {
542 542
 	
543
-			echo '<h2>' . esc_html( $title ) . '</h2>';
543
+			echo '<h2>' . esc_html($title) . '</h2>';
544 544
 	
545 545
 			echo '<ul>';
546
-			while($post_type_items->have_posts()){ $post_type_items->the_post();
547
-				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>';
546
+			while ($post_type_items->have_posts()) { $post_type_items->the_post();
547
+				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>';
548 548
 			}
549 549
 			echo '</ul>';
550 550
 	
@@ -560,20 +560,20 @@  discard block
 block discarded – undo
560 560
  * @subpackage	template-tags
561 561
  * @category	sitemap
562 562
  */
563
-function lsx_sitemap_taxonomy_clouds(){
563
+function lsx_sitemap_taxonomy_clouds() {
564 564
 
565
-		$taxonomy_args =  array(
565
+		$taxonomy_args = array(
566 566
 			'public'				=> true,
567 567
 			'_builtin' 				=> false
568 568
 		);
569 569
 		$taxonomies = get_taxonomies($taxonomy_args);
570
-		if(!empty($taxonomies)){
571
-			foreach($taxonomies as $taxonomy_id => $taxonomy) {
570
+		if ( ! empty($taxonomies)) {
571
+			foreach ($taxonomies as $taxonomy_id => $taxonomy) {
572 572
 
573
-				$tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id,'echo'=>false));
574
-				if(null != $tag_cloud){
575
-					echo '<h2>' . esc_html( $taxonomy ) . '</h2>';
576
-					echo '<aside id="' . esc_attr( $taxonomy_id ) . '" class="widget widget_' . esc_attr( $taxonomy_id ) . '">' . esc_html( $tag_cloud ) . '</aside>';
573
+				$tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id, 'echo'=>false));
574
+				if (null != $tag_cloud) {
575
+					echo '<h2>' . esc_html($taxonomy) . '</h2>';
576
+					echo '<aside id="' . esc_attr($taxonomy_id) . '" class="widget widget_' . esc_attr($taxonomy_id) . '">' . esc_html($tag_cloud) . '</aside>';
577 577
 		        }
578 578
 	        }
579 579
         } 
@@ -586,15 +586,15 @@  discard block
 block discarded – undo
586 586
  * @subpackage	hooks
587 587
  * @category	forms
588 588
  */
589
-add_action( 'lsx_footer_before', 'lsx_footer_subscription_cta', 10 );
589
+add_action('lsx_footer_before', 'lsx_footer_subscription_cta', 10);
590 590
 function lsx_footer_subscription_cta() {
591
-	if(!function_exists('lsx_is_form_enabled')){ return; }
591
+	if ( ! function_exists('lsx_is_form_enabled')) { return; }
592 592
 	$subscribe_form_id = lsx_is_form_enabled('subscribe');
593
-	if(false == $subscribe_form_id) { return; }
593
+	if (false == $subscribe_form_id) { return; }
594 594
 
595 595
 	//add Caldera Forms Fields Scripts
596
-	if( defined( 'CFCORE_VER' ) ){
597
-		wp_enqueue_script( 'cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER );
596
+	if (defined('CFCORE_VER')) {
597
+		wp_enqueue_script('cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER);
598 598
 	}
599 599
 
600 600
 	?>
@@ -602,8 +602,8 @@  discard block
 block discarded – undo
602 602
 		<div class="container">
603 603
 			<div class="row">
604 604
 				<div class="col-md-12">
605
-					<h2><?php esc_html_e( 'Subscribe to Our Newsletter', 'lsx' ); ?></h2>
606
-					<?php echo do_shortcode( '[caldera_form id="'.$subscribe_form_id.'"]' ); ?>
605
+					<h2><?php esc_html_e('Subscribe to Our Newsletter', 'lsx'); ?></h2>
606
+					<?php echo do_shortcode('[caldera_form id="' . $subscribe_form_id . '"]'); ?>
607 607
 				</div>
608 608
 			</div>
609 609
 		</div>
@@ -618,14 +618,14 @@  discard block
 block discarded – undo
618 618
  * @subpackage	hooks
619 619
  * @category	menu
620 620
  */
621
-add_action( 'lsx_header_top', 'lsx_add_top_menu' );
621
+add_action('lsx_header_top', 'lsx_add_top_menu');
622 622
 function lsx_add_top_menu() {
623 623
 	if (has_nav_menu('top-menu')) { ?>
624 624
 		<div id="top-menu" class="<?php lsx_top_menu_classes(); ?>">
625 625
 			<div class="container">
626 626
 				<nav class="top-menu">
627 627
 		    		<?php
628
-		    			wp_nav_menu( array(
628
+		    			wp_nav_menu(array(
629 629
 							'theme_location' => 'top-menu',
630 630
 							'walker' => new Lsx_Bootstrap_Navwalker())
631 631
 						);
@@ -643,24 +643,24 @@  discard block
 block discarded – undo
643 643
  * @subpackage	template-tag
644 644
  * @category 	forms
645 645
  */
646
-if ( class_exists('Caldera_Forms') && !function_exists( 'lsx_is_form_enabled' ) ) {
646
+if (class_exists('Caldera_Forms') && ! function_exists('lsx_is_form_enabled')) {
647 647
 	function lsx_is_form_enabled($slug = false) {
648
-		if(false == $slug){ return false; }
648
+		if (false == $slug) { return false; }
649 649
 	
650 650
 		$match = false;
651
-		$forms = get_option( '_caldera_forms' , false );
652
-		if(false !== $forms ) {
653
-			foreach($forms as $form_id=>$form_maybe){
654
-				if( trim(strtolower($slug)) == strtolower($form_maybe['name']) ){
651
+		$forms = get_option('_caldera_forms', false);
652
+		if (false !== $forms) {
653
+			foreach ($forms as $form_id=>$form_maybe) {
654
+				if (trim(strtolower($slug)) == strtolower($form_maybe['name'])) {
655 655
 					$match = $form_id;
656 656
 					break;
657 657
 				}
658 658
 			}
659 659
 		}
660
-		if( false === $match ){
661
-			$is_form = Caldera_Forms::get_form( strtolower( $slug ) );
662
-			if( !empty( $is_form ) ){
663
-				return strtolower( $slug );
660
+		if (false === $match) {
661
+			$is_form = Caldera_Forms::get_form(strtolower($slug));
662
+			if ( ! empty($is_form)) {
663
+				return strtolower($slug);
664 664
 			}
665 665
 		}
666 666
 	
@@ -676,10 +676,10 @@  discard block
 block discarded – undo
676 676
  * @category 	urls
677 677
  */
678 678
 function lsx_get_my_url() {
679
-	if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) )
679
+	if ( ! preg_match('/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches))
680 680
 		return false;
681 681
 
682
-	return esc_url_raw( $matches[1] );
682
+	return esc_url_raw($matches[1]);
683 683
 }
684 684
 
685 685
 /**
@@ -689,19 +689,19 @@  discard block
 block discarded – undo
689 689
  * @subpackage 	extras
690 690
  * @category 	urls
691 691
  */
692
-function lsx_get_template_part($slug,$part) {
692
+function lsx_get_template_part($slug, $part) {
693 693
 	$template = array();
694 694
 	$part = (string) $part;
695
-	if ( '' !== $part ){
695
+	if ('' !== $part) {
696 696
 		$template = "{$slug}-{$part}.php";
697
-	}else{
697
+	} else {
698 698
 		$template = "{$slug}.php";
699 699
 	}
700
-	$file_path = apply_filters('lsx_content_path',false,$slug,$part);
700
+	$file_path = apply_filters('lsx_content_path', false, $slug, $part);
701 701
 
702
-	if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) {
703
-		load_template( $file_path.$template, false );
704
-	}else{
705
-		get_template_part($slug,$part);
702
+	if (false !== $file_path && '' == locate_template(array($template)) && file_exists($file_path . $template)) {
703
+		load_template($file_path . $template, false);
704
+	} else {
705
+		get_template_part($slug, $part);
706 706
 	}
707 707
 }
708 708
\ No newline at end of file
Please login to merge, or discard this patch.
inc/config.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,51 +28,51 @@  discard block
 block discarded – undo
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' , 'lsx' ),
50
-		'social'=> esc_html__( 'Social Menu' , 'lsx' ),
51
-		'footer'=> esc_html__( 'Footer Menu' , 'lsx' )
52
-	) );	
47
+	register_nav_menus(array(
48
+		'primary' => esc_html__('Primary Menu', 'lsx'),
49
+		'top-menu'=> esc_html__('Top Menu', 'lsx'),
50
+		'social'=> esc_html__('Social Menu', 'lsx'),
51
+		'footer'=> esc_html__('Footer Menu', 'lsx')
52
+	));	
53 53
 
54 54
 	//Set the content width
55 55
 	$content_width = 1140;
56 56
 	
57
-	add_editor_style( get_template_directory_uri() . '/css/editor-style.css' );	
58
-	add_theme_support( 'html5', array( 'caption' ) );
57
+	add_editor_style(get_template_directory_uri() . '/css/editor-style.css');	
58
+	add_theme_support('html5', array('caption'));
59 59
 
60
-	add_theme_support( 'woocommerce' );	
61
-	add_theme_support( 'sensei' );
60
+	add_theme_support('woocommerce');	
61
+	add_theme_support('sensei');
62 62
 }
63 63
 endif; // lsx_setup
64
-add_action( 'after_setup_theme', 'lsx_setup' );
64
+add_action('after_setup_theme', 'lsx_setup');
65 65
 
66 66
 /**
67 67
  * Removes the "Custom Fields" meta box.
68 68
  */
69 69
 function lsx_remove_meta_boxes() {
70 70
 	$post_types = get_post_types();
71
-	foreach($post_types as $post_type){
72
-		remove_meta_box( 'postcustom' , $post_type , 'normal' ); 
71
+	foreach ($post_types as $post_type) {
72
+		remove_meta_box('postcustom', $post_type, 'normal'); 
73 73
 	}
74 74
 }
75
-add_action( 'admin_menu' , 'lsx_remove_meta_boxes' );
75
+add_action('admin_menu', 'lsx_remove_meta_boxes');
76 76
 
77 77
 /**
78 78
  * Overwrite the $content_width var, based on the layout of the page.
@@ -84,33 +84,33 @@  discard block
 block discarded – undo
84 84
 function lsx_process_content_width() {
85 85
 	global $content_width;
86 86
 
87
-	if(
87
+	if (
88 88
 		is_page_template('page-templates/template-portfolio.php') ||
89 89
 		is_page_template('page-templates/template-front-page.php') ||
90 90
 		is_page_template('page-templates/template-full-width.php') ||
91 91
 		is_post_type_archive('jetpack-portfolio') ||
92
-		is_tax(array('jetpack-portfolio-type','jetpack-portfolio-tag')) ||
92
+		is_tax(array('jetpack-portfolio-type', 'jetpack-portfolio-tag')) ||
93 93
 		is_singular('jetpack-portfolio')
94
-	){
94
+	) {
95 95
 		$content_width = 1140;
96 96
 	}
97 97
 }
98
-add_action('wp_head','lsx_process_content_width');
98
+add_action('wp_head', 'lsx_process_content_width');
99 99
 
100 100
 /**
101 101
  * Disable the comments form by default for the page post type.
102 102
  * @package	lsx
103 103
  * @subpackage config
104 104
  */
105
-function lsx_page_comments_off( $data ) {
106
-	if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) {
105
+function lsx_page_comments_off($data) {
106
+	if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) {
107 107
 		$data['comment_status'] = 0;
108 108
 		$data['ping_status'] = 0;
109 109
 	}
110 110
 
111 111
 	return $data;
112 112
 }
113
-add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' );
113
+add_filter('wp_insert_post_data', 'lsx_page_comments_off');
114 114
 
115 115
 /**
116 116
  * Disable the comments form by default for the page post type.
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
  * @subpackage config
119 119
  */
120 120
 function lsx_is_legacy($data) {
121
-	if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) {
121
+	if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) {
122 122
 		$data['comment_status'] = 0;
123 123
 		$data['ping_status'] = 0;
124 124
 	}
125 125
 
126 126
 	return $data;
127 127
 }
128
-add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' );
128
+add_filter('wp_insert_post_data', 'lsx_page_comments_off');
129 129
 
130 130
 /**
131 131
  * Run the init command
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
  * @subpackage config
134 134
  */
135 135
 function lsx_init() {
136
-	if(class_exists('WooCommerce')){
137
-		remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
136
+	if (class_exists('WooCommerce')) {
137
+		remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0);
138 138
 	}
139 139
 }
140
-add_action( 'init', 'lsx_init',100 );
140
+add_action('init', 'lsx_init', 100);
141 141
 
142 142
 /**
143 143
  * Run on the wp_head 
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
  */
147 147
 function lsx_wp_head() {
148 148
 
149
-	$layout = get_theme_mod('lsx_layout','2cr');
150
-	$layout = apply_filters( 'lsx_layout', $layout );
149
+	$layout = get_theme_mod('lsx_layout', '2cr');
150
+	$layout = apply_filters('lsx_layout', $layout);
151 151
 
152
-	if('1c' === $layout && (is_author() || is_search() || (is_post_type_archive(array('post','page','jetpack-portfolio')) && !is_post_type_archive('tribe_events')) || is_tag() || is_category() || is_date() || is_tax('post_format')) ){
153
-		remove_action('lsx_content_top', 'lsx_breadcrumbs', 100 );
152
+	if ('1c' === $layout && (is_author() || is_search() || (is_post_type_archive(array('post', 'page', 'jetpack-portfolio')) && ! is_post_type_archive('tribe_events')) || is_tag() || is_category() || is_date() || is_tax('post_format'))) {
153
+		remove_action('lsx_content_top', 'lsx_breadcrumbs', 100);
154 154
 	}
155 155
 }
156
-add_action( 'wp_head', 'lsx_wp_head',100 );
156
+add_action('wp_head', 'lsx_wp_head', 100);
Please login to merge, or discard this patch.
inc/widgets.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,53 +1,53 @@  discard block
 block discarded – undo
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
  * Register widgetized area and update sidebar with default widgets.
6 6
  */
7 7
 function lsx_widget_area_init() {
8 8
 	
9
-	register_sidebar( array(
10
-		'name'          => esc_html__( 'Home', 'lsx' ),
9
+	register_sidebar(array(
10
+		'name'          => esc_html__('Home', 'lsx'),
11 11
 		'id'            => 'sidebar-home',
12 12
 		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
13 13
 		'after_widget'  => '</aside>',
14 14
 		'before_title'  => '<h3 class="widget-title">',
15 15
 		'after_title'   => '</h3>',
16
-	) );
16
+	));
17 17
 	
18
-	register_sidebar( array(
19
-		'name'          => esc_html__( 'Sidebar', 'lsx' ),
18
+	register_sidebar(array(
19
+		'name'          => esc_html__('Sidebar', 'lsx'),
20 20
 		'id'            => 'sidebar-1',
21 21
 		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
22 22
 		'after_widget'  => '</aside>',
23 23
 		'before_title'  => '<h3 class="widget-title">',
24 24
 		'after_title'   => '</h3>',
25
-	) );
25
+	));
26 26
 
27
-	register_sidebar( array(
28
-		'name'          => esc_html__( 'Footer', 'lsx' ),
27
+	register_sidebar(array(
28
+		'name'          => esc_html__('Footer', 'lsx'),
29 29
 		'id'            => 'sidebar-footer',
30 30
 		'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">',
31 31
 		'after_widget'  => '</aside></div>',
32 32
 		'before_title'  => '<h3 class="widget-title">',
33 33
 		'after_title'   => '</h3>',
34
-	) );
34
+	));
35 35
 
36
-	register_sidebar( array(
37
-		'name'          => esc_html__( 'Footer Call to Action', 'lsx' ),
36
+	register_sidebar(array(
37
+		'name'          => esc_html__('Footer Call to Action', 'lsx'),
38 38
 		'id'            => 'sidebar-footer-cta',
39 39
 		'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">',
40 40
 		'after_widget'  => '</aside></div>',
41 41
 		'before_title'  => '<h3 class="widget-title">',
42 42
 		'after_title'   => '</h3>',
43
-	) );
43
+	));
44 44
 }
45
-add_action( 'widgets_init', 'lsx_widget_area_init' );
45
+add_action('widgets_init', 'lsx_widget_area_init');
46 46
 
47
-function lsx_sidebar_footer_params( $params ) {
47
+function lsx_sidebar_footer_params($params) {
48 48
     $sidebar_id = $params[0]['id'];
49 49
 
50
-    if ( 'sidebar-footer' == $sidebar_id ) {
50
+    if ('sidebar-footer' == $sidebar_id) {
51 51
         $total_widgets = wp_get_sidebars_widgets();
52 52
         $sidebar_widgets = count($total_widgets[$sidebar_id]);
53 53
 
@@ -56,4 +56,4 @@  discard block
 block discarded – undo
56 56
 
57 57
     return $params;
58 58
 }
59
-add_filter( 'dynamic_sidebar_params', 'lsx_sidebar_footer_params' ); 
60 59
\ No newline at end of file
60
+add_filter('dynamic_sidebar_params', 'lsx_sidebar_footer_params'); 
61 61
\ No newline at end of file
Please login to merge, or discard this patch.
inc/the-events-calendar.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
  */
19 19
 
20 20
 function lsx_events_styles() {
21
-    wp_enqueue_style( 'events', get_template_directory_uri() . '/css/the-events-calendar.css', array(), LSX_VERSION );
21
+    wp_enqueue_style('events', get_template_directory_uri() . '/css/the-events-calendar.css', array(), LSX_VERSION);
22 22
 }
23
-add_action( 'wp_enqueue_scripts', 'lsx_events_styles' );
23
+add_action('wp_enqueue_scripts', 'lsx_events_styles');
24 24
 
25 25
 
26 26
 /**
@@ -32,41 +32,41 @@  discard block
 block discarded – undo
32 32
 
33 33
 function lsx_tribe_breadcrumbs($output) {
34 34
 	global $wp_query;
35
-	if( (isset($wp_query->tribe_is_event) && true === $wp_query->tribe_is_event) || (isset($wp_query->query_vars['post_type']) && !is_array($wp_query->query_vars['post_type']) && 'tribe_venue' === $wp_query->query_vars['post_type'])){
36
-		if(function_exists('woocommerce_breadcrumb')){
35
+	if ((isset($wp_query->tribe_is_event) && true === $wp_query->tribe_is_event) || (isset($wp_query->query_vars['post_type']) && ! is_array($wp_query->query_vars['post_type']) && 'tribe_venue' === $wp_query->query_vars['post_type'])) {
36
+		if (function_exists('woocommerce_breadcrumb')) {
37 37
 		 	$closing_div = '</nav>';
38 38
 
39
-		 	if( is_single()) {
40
-		 		$output = str_replace('Page','<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.esc_html__('Events','lsx').'</a>',$output);
41
-		 		if(isset($wp_query->query_vars['eventDisplay']) && 'all' === $wp_query->query_vars['eventDisplay']){
42
-		 			$output = str_replace($closing_div,get_the_title($wp_query->query_vars['post_parent']).$closing_div,$output);
43
-		 		}else{
39
+		 	if (is_single()) {
40
+		 		$output = str_replace('Page', '<a href="' . get_post_type_archive_link('tribe_events') . '">' . esc_html__('Events', 'lsx') . '</a>', $output);
41
+		 		if (isset($wp_query->query_vars['eventDisplay']) && 'all' === $wp_query->query_vars['eventDisplay']) {
42
+		 			$output = str_replace($closing_div, get_the_title($wp_query->query_vars['post_parent']) . $closing_div, $output);
43
+		 		} else {
44 44
 		 			$single_event = get_queried_object();
45
-		 			$output = str_replace($closing_div,apply_filters('the_title',$single_event->post_title).$closing_div,$output);		 			
45
+		 			$output = str_replace($closing_div, apply_filters('the_title', $single_event->post_title) . $closing_div, $output);		 			
46 46
 		 		}
47
-		 	}elseif( is_tax()) {
47
+		 	}elseif (is_tax()) {
48 48
 		 		$tax_event = get_queried_object();
49
-		 		$output = str_replace('Page','<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.esc_html__('Events','lsx').'</a>',$output);
50
-		 		$output = str_replace($closing_div,'&nbsp;/&nbsp;'.apply_filters('the_title',$tax_event->name).$closing_div,$output);
51
-		 	}else{
52
-		 		$output = str_replace('Page',esc_html__('Events','lsx'),$output);
49
+		 		$output = str_replace('Page', '<a href="' . get_post_type_archive_link('tribe_events') . '">' . esc_html__('Events', 'lsx') . '</a>', $output);
50
+		 		$output = str_replace($closing_div, '&nbsp;/&nbsp;' . apply_filters('the_title', $tax_event->name) . $closing_div, $output);
51
+		 	} else {
52
+		 		$output = str_replace('Page', esc_html__('Events', 'lsx'), $output);
53 53
 		 	}		 	
54
-		 }elseif(function_exists('yoast_breadcrumb')){
54
+		 }elseif (function_exists('yoast_breadcrumb')) {
55 55
 		 	$closing_div = '</div>';
56
-		 	$last_breadcrumb = '<span class="breadcrumb_last">'.esc_html__('Events','lsx').'</span>';
56
+		 	$last_breadcrumb = '<span class="breadcrumb_last">' . esc_html__('Events', 'lsx') . '</span>';
57 57
 		 	
58
-		 	if( is_single()) {
58
+		 	if (is_single()) {
59 59
 		 		$single_event = get_queried_object();
60
-		 		$output = str_replace($closing_div,'<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.esc_html__('Events','lsx').'</a>&nbsp;/&nbsp;'.apply_filters('the_title',$single_event->post_title),$output);
61
-		 	}elseif( is_tax()) {
60
+		 		$output = str_replace($closing_div, '<a href="' . get_post_type_archive_link('tribe_events') . '">' . esc_html__('Events', 'lsx') . '</a>&nbsp;/&nbsp;' . apply_filters('the_title', $single_event->post_title), $output);
61
+		 	}elseif (is_tax()) {
62 62
 		 		$tax_event = get_queried_object();
63
-		 		$output = str_replace($last_breadcrumb,'<a href="'.get_post_type_archive_link( 'tribe_events' ).'">'.esc_html__('Events','lsx').'</a>&nbsp;/&nbsp;'.apply_filters('the_title',$tax_event->name),$output);
63
+		 		$output = str_replace($last_breadcrumb, '<a href="' . get_post_type_archive_link('tribe_events') . '">' . esc_html__('Events', 'lsx') . '</a>&nbsp;/&nbsp;' . apply_filters('the_title', $tax_event->name), $output);
64 64
 		 		
65
-		 	}else{
66
-		 		$output = str_replace('Page',esc_html__('Events','lsx'),$output);
65
+		 	} else {
66
+		 		$output = str_replace('Page', esc_html__('Events', 'lsx'), $output);
67 67
 		 	}		 	
68 68
 		 }		
69 69
 	}
70 70
 	return $output;
71 71
 }
72
-add_filter( 'lsx_breadcrumbs', 'lsx_tribe_breadcrumbs',1,10 );
73 72
\ No newline at end of file
73
+add_filter('lsx_breadcrumbs', 'lsx_tribe_breadcrumbs', 1, 10);
74 74
\ No newline at end of file
Please login to merge, or discard this patch.
inc/jetpack.php 1 patch
Spacing   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function lsx_allowed_related_post_types($allowed_post_types) {
21 21
 	$allowed_post_types[] = 'jetpack-portfolio';
22
-	foreach($allowed_post_types as $key => $value){
23
-		if('page' == $value){
22
+	foreach ($allowed_post_types as $key => $value) {
23
+		if ('page' == $value) {
24 24
 			unset($allowed_post_types[$key]);
25 25
 		}
26 26
 	}
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
  * @category site-logo
36 36
  */
37 37
 
38
-function lsx_site_logo_title_tag( $html) {
38
+function lsx_site_logo_title_tag($html) {
39 39
 
40
-	$html = str_replace('<a', '<a title="'.get_bloginfo('name').'" ', $html);
40
+	$html = str_replace('<a', '<a title="' . get_bloginfo('name') . '" ', $html);
41 41
 	return $html;
42 42
 }
43
-add_filter( 'jetpack_the_site_logo', 'lsx_site_logo_title_tag');
43
+add_filter('jetpack_the_site_logo', 'lsx_site_logo_title_tag');
44 44
 
45 45
 
46 46
 /*
@@ -54,19 +54,19 @@  discard block
 block discarded – undo
54 54
  * @subpackage jetpack
55 55
  * @category portfolio
56 56
  */
57
-function lsx_portfolio_infinite_scroll(){
58
-	global $_wp_theme_features,$wp_query;
57
+function lsx_portfolio_infinite_scroll() {
58
+	global $_wp_theme_features, $wp_query;
59 59
 
60
-	if(is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag')){
60
+	if (is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag')) {
61 61
 		
62
-		if(class_exists('The_Neverending_Home_Page')){
62
+		if (class_exists('The_Neverending_Home_Page')) {
63 63
 			$_wp_theme_features['infinite-scroll'][0]['container'] = 'portfolio-infinite-scroll-wrapper';
64 64
 			$_wp_theme_features['infinite-scroll'][0]['posts_per_page'] = 99;
65 65
 		}
66 66
 	}
67 67
 
68 68
 }
69
-add_action('wp_head','lsx_portfolio_infinite_scroll',1000);
69
+add_action('wp_head', 'lsx_portfolio_infinite_scroll', 1000);
70 70
 
71 71
 /**
72 72
  * Disables the infinite scroll on the portfolio archive
@@ -75,13 +75,13 @@  discard block
 block discarded – undo
75 75
  * @subpackage jetpack
76 76
  * @category portfolio
77 77
  */
78
-function lsx_portfolio_infinite_scroll_disable($supported){
79
-	if(is_post_type_archive('jetpack-portfolio')){
78
+function lsx_portfolio_infinite_scroll_disable($supported) {
79
+	if (is_post_type_archive('jetpack-portfolio')) {
80 80
 		$supported = false;
81 81
 	}
82 82
 	return $supported;
83 83
 }
84
-add_filter( 'infinite_scroll_archive_supported', 'lsx_portfolio_infinite_scroll_disable', 1, 10 );
84
+add_filter('infinite_scroll_archive_supported', 'lsx_portfolio_infinite_scroll_disable', 1, 10);
85 85
 
86 86
 /**
87 87
  * Set the Portfolio to 9 posts per page
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
  * @subpackage jetpack
91 91
  * @category portfolio
92 92
 */
93
-function lsx_portfolio_archive_pagination( $query ) {
94
-	if(!is_admin()){
95
-		if ( $query->is_post_type_archive(array('jetpack-portfolio')) && $query->is_main_query() && class_exists('The_Neverending_Home_Page')) {
96
-			$query->set( 'posts_per_page', -1 );
93
+function lsx_portfolio_archive_pagination($query) {
94
+	if ( ! is_admin()) {
95
+		if ($query->is_post_type_archive(array('jetpack-portfolio')) && $query->is_main_query() && class_exists('The_Neverending_Home_Page')) {
96
+			$query->set('posts_per_page', -1);
97 97
 		}
98 98
 	}
99 99
 }
100
-add_action( 'pre_get_posts', 'lsx_portfolio_archive_pagination' , 100 );
100
+add_action('pre_get_posts', 'lsx_portfolio_archive_pagination', 100);
101 101
 
102 102
 /**
103 103
  * Remove the related posts from below the content area.
@@ -107,13 +107,13 @@  discard block
 block discarded – undo
107 107
  * @category portfolio
108 108
  */
109 109
 function lsx_remove_portfolio_related_posts() {
110
-	if ( is_single() && 'jetpack-portfolio' == get_post_type() && class_exists( 'Jetpack_RelatedPosts' ) ) {
110
+	if (is_single() && 'jetpack-portfolio' == get_post_type() && class_exists('Jetpack_RelatedPosts')) {
111 111
 		$jprp = Jetpack_RelatedPosts::init();
112
-		$callback = array( $jprp, 'filter_add_target_to_dom' );
113
-		remove_filter( 'the_content', $callback, 40 );
112
+		$callback = array($jprp, 'filter_add_target_to_dom');
113
+		remove_filter('the_content', $callback, 40);
114 114
 	}
115 115
 }
116
-add_filter( 'wp', 'lsx_remove_portfolio_related_posts', 20 );
116
+add_filter('wp', 'lsx_remove_portfolio_related_posts', 20);
117 117
 
118 118
 /**
119 119
  * Remove the related posts from below the content area.
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
  * @category portfolio
124 124
  */
125 125
 function lsx_remove_single_related_posts() {
126
-    if ( is_single() && class_exists( 'Jetpack_RelatedPosts' ) ) {
126
+    if (is_single() && class_exists('Jetpack_RelatedPosts')) {
127 127
         $jprp = Jetpack_RelatedPosts::init();
128
-        $callback = array( $jprp, 'filter_add_target_to_dom' );
129
-        remove_filter( 'the_content', $callback, 40 );
128
+        $callback = array($jprp, 'filter_add_target_to_dom');
129
+        remove_filter('the_content', $callback, 40);
130 130
     }
131 131
 }
132
-add_filter( 'wp', 'lsx_remove_single_related_posts', 20 );
132
+add_filter('wp', 'lsx_remove_single_related_posts', 20);
133 133
 
134 134
 /**
135 135
  * A template tag to call the Portfolios Related posts
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
  * @subpackage jetpack
139 139
  * @category portfolio
140 140
  */
141
-function lsx_portfolio_related_posts(){
142
-	if(class_exists('Jetpack_RelatedPosts')){ ?>
141
+function lsx_portfolio_related_posts() {
142
+	if (class_exists('Jetpack_RelatedPosts')) { ?>
143 143
 		<div class="row">
144 144
 			<div class="col-md-12">
145 145
 				<?php echo do_shortcode('[jetpack-related-posts]'); ?>
@@ -156,16 +156,16 @@  discard block
 block discarded – undo
156 156
  * @category portfolio
157 157
  */
158 158
 function lsx_portfolio_remove_share() {
159
-	if ( ( is_single() && 'jetpack-portfolio' == get_post_type() ) || is_page_template( 'page-templates/template-portfolio.php' ) ) {
160
-		remove_filter( 'the_content', 'sharing_display',19 );
161
-		remove_filter( 'the_excerpt', 'sharing_display',19 );
159
+	if ((is_single() && 'jetpack-portfolio' == get_post_type()) || is_page_template('page-templates/template-portfolio.php')) {
160
+		remove_filter('the_content', 'sharing_display', 19);
161
+		remove_filter('the_excerpt', 'sharing_display', 19);
162 162
 
163
-		if ( class_exists( 'Jetpack_Likes' ) ) {
164
-			remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );
163
+		if (class_exists('Jetpack_Likes')) {
164
+			remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
165 165
 		}
166 166
 	}
167 167
 }
168
-add_action( 'loop_start', 'lsx_portfolio_remove_share' );
168
+add_action('loop_start', 'lsx_portfolio_remove_share');
169 169
 
170 170
 /**
171 171
  * Remove the sharing from single
@@ -175,16 +175,16 @@  discard block
 block discarded – undo
175 175
  * @category post
176 176
  */
177 177
 function lsx_single_remove_share() {
178
-	if ( is_single() ) {
179
-		remove_filter( 'the_content', 'sharing_display',19 );
180
-		remove_filter( 'the_excerpt', 'sharing_display',19 );
178
+	if (is_single()) {
179
+		remove_filter('the_content', 'sharing_display', 19);
180
+		remove_filter('the_excerpt', 'sharing_display', 19);
181 181
 
182
-		if ( class_exists( 'Jetpack_Likes' ) ) {
183
-			remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );
182
+		if (class_exists('Jetpack_Likes')) {
183
+			remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1);
184 184
 		}
185 185
 	}
186 186
 }
187
-add_action( 'loop_start', 'lsx_single_remove_share' );
187
+add_action('loop_start', 'lsx_single_remove_share');
188 188
 
189 189
 /**
190 190
  * Redirect the template archive to our one
@@ -193,18 +193,18 @@  discard block
 block discarded – undo
193 193
  * @subpackage jetpack
194 194
  * @category portfolio
195 195
 */
196
-function lsx_portfolio_taxonomy_template( $template ) {
196
+function lsx_portfolio_taxonomy_template($template) {
197 197
 
198
-	if ( is_tax(array('jetpack-portfolio-type','jetpack-portfolio-tag'))  ) {
199
-		$new_template = locate_template( array( 'archive-jetpack-portfolio.php' ) );
200
-		if ( '' != $new_template ) {
201
-			return $new_template ;
198
+	if (is_tax(array('jetpack-portfolio-type', 'jetpack-portfolio-tag'))) {
199
+		$new_template = locate_template(array('archive-jetpack-portfolio.php'));
200
+		if ('' != $new_template) {
201
+			return $new_template;
202 202
 		}
203 203
 	}
204 204
 
205 205
 	return $template;
206 206
 }
207
-add_filter( 'template_include', 'lsx_portfolio_taxonomy_template', 99 );
207
+add_filter('template_include', 'lsx_portfolio_taxonomy_template', 99);
208 208
 
209 209
 
210 210
 /**
@@ -214,43 +214,43 @@  discard block
 block discarded – undo
214 214
  * @subpackage jetpack
215 215
  * @category portfolio
216 216
  */
217
-add_action( 'add_meta_boxes', 'lsx_add_portfolio_post_meta_boxes' );
218
-add_action( 'save_post', 'lsx_save_portfolio_post_meta', 100, 2 );
217
+add_action('add_meta_boxes', 'lsx_add_portfolio_post_meta_boxes');
218
+add_action('save_post', 'lsx_save_portfolio_post_meta', 100, 2);
219 219
 
220
-function lsx_save_portfolio_post_meta( $post_id, $post ) {
221
-	if ( 'jetpack-portfolio' != $post->post_type ) {
220
+function lsx_save_portfolio_post_meta($post_id, $post) {
221
+	if ('jetpack-portfolio' != $post->post_type) {
222 222
 		return;
223 223
 	}
224 224
 
225
-	if ( ! isset( $_POST['lsx-website'] ) && ! isset( $_POST['lsx-client'] ) ) {
225
+	if ( ! isset($_POST['lsx-website']) && ! isset($_POST['lsx-client'])) {
226 226
 		return;
227 227
 	}
228 228
 
229
-	$post_type = get_post_type_object( $post->post_type );
229
+	$post_type = get_post_type_object($post->post_type);
230 230
 
231
-	if ( ! current_user_can( $post_type->cap->edit_post, $post_id ) ) {
231
+	if ( ! current_user_can($post_type->cap->edit_post, $post_id)) {
232 232
 		return;
233 233
 	}
234 234
 
235
-	check_admin_referer( 'lsx_save_portfolio', '_lsx_client_nonce' );
236
-	check_admin_referer( 'lsx_save_portfolio', '_lsx_website_nonce' );
235
+	check_admin_referer('lsx_save_portfolio', '_lsx_client_nonce');
236
+	check_admin_referer('lsx_save_portfolio', '_lsx_website_nonce');
237 237
 
238
-	$meta_keys = array('lsx-website','lsx-client');
238
+	$meta_keys = array('lsx-website', 'lsx-client');
239 239
 
240
-	foreach($meta_keys as $meta_key){
241
-		$new_meta_value = sanitize_text_field( wp_unslash( $_POST[$meta_key] ) );
242
-		$new_meta_value = ! empty( $new_meta_value ) ? $new_meta_value : '';
240
+	foreach ($meta_keys as $meta_key) {
241
+		$new_meta_value = sanitize_text_field(wp_unslash($_POST[$meta_key]));
242
+		$new_meta_value = ! empty($new_meta_value) ? $new_meta_value : '';
243 243
 
244
-		$meta_value = get_post_meta( $post_id, $meta_key, true );
244
+		$meta_value = get_post_meta($post_id, $meta_key, true);
245 245
 
246
-		if ( $new_meta_value && '' == $meta_value )
247
-			add_post_meta( $post_id, $meta_key, $new_meta_value, true );
246
+		if ($new_meta_value && '' == $meta_value)
247
+			add_post_meta($post_id, $meta_key, $new_meta_value, true);
248 248
 
249
-		elseif ( $new_meta_value && $new_meta_value != $meta_value )
250
-		update_post_meta( $post_id, $meta_key, $new_meta_value );
249
+		elseif ($new_meta_value && $new_meta_value != $meta_value)
250
+		update_post_meta($post_id, $meta_key, $new_meta_value);
251 251
 
252
-		elseif ( '' == $new_meta_value && $meta_value )
253
-		delete_post_meta( $post_id, $meta_key, $meta_value );
252
+		elseif ('' == $new_meta_value && $meta_value)
253
+		delete_post_meta($post_id, $meta_key, $meta_value);
254 254
 	}
255 255
 }
256 256
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
 	add_meta_box(
260 260
 	'lsx_client_meta_box',
261
-	esc_html__( 'Client', 'lsx' ),
261
+	esc_html__('Client', 'lsx'),
262 262
 	'lsx_client_meta_box',
263 263
 	'jetpack-portfolio',
264 264
 	'side',
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 
268 268
 	add_meta_box(
269 269
 	'lsx_website_meta_box',
270
-	esc_html__( 'Website', 'lsx' ),
270
+	esc_html__('Website', 'lsx'),
271 271
 	'lsx_website_meta_box',
272 272
 	'jetpack-portfolio',
273 273
 	'side',
@@ -275,25 +275,25 @@  discard block
 block discarded – undo
275 275
 			);
276 276
 }
277 277
 
278
-function lsx_client_meta_box( $object, $box ) { ?>
278
+function lsx_client_meta_box($object, $box) { ?>
279 279
 
280
-  <?php wp_nonce_field( 'lsx_save_portfolio', '_lsx_client_nonce' ); ?>
280
+  <?php wp_nonce_field('lsx_save_portfolio', '_lsx_client_nonce'); ?>
281 281
 
282 282
   <p>
283
-    <input class="widefat" type="text" name="lsx-client" id="lsx-client" value="<?php echo esc_attr( get_post_meta( $object->ID, 'lsx-client', true ) ); ?>" size="30" />
283
+    <input class="widefat" type="text" name="lsx-client" id="lsx-client" value="<?php echo esc_attr(get_post_meta($object->ID, 'lsx-client', true)); ?>" size="30" />
284 284
     <br /><br />
285
-    <label for="lsx-client"><?php esc_html_e( 'Enter the name of the project client', 'lsx' ); ?></label>
285
+    <label for="lsx-client"><?php esc_html_e('Enter the name of the project client', 'lsx'); ?></label>
286 286
   </p>
287 287
 <?php }
288 288
 
289
-function lsx_website_meta_box( $object, $box ) { ?>
289
+function lsx_website_meta_box($object, $box) { ?>
290 290
 
291
-  <?php wp_nonce_field( 'lsx_save_portfolio', '_lsx_website_nonce' ); ?>
291
+  <?php wp_nonce_field('lsx_save_portfolio', '_lsx_website_nonce'); ?>
292 292
 
293 293
   <p>
294
-    <input class="widefat" type="text" name="lsx-website" id="lsx-website" value="<?php echo esc_attr( get_post_meta( $object->ID, 'lsx-website', true ) ); ?>" size="30" />
294
+    <input class="widefat" type="text" name="lsx-website" id="lsx-website" value="<?php echo esc_attr(get_post_meta($object->ID, 'lsx-website', true)); ?>" size="30" />
295 295
     <br /><br />
296
-    <label for="lsx-website"><?php esc_html_e( 'Enter the URL of the project website', 'lsx' ); ?></label>
296
+    <label for="lsx-website"><?php esc_html_e('Enter the URL of the project website', 'lsx'); ?></label>
297 297
   </p>
298 298
 <?php }
299 299
 
@@ -306,18 +306,18 @@  discard block
 block discarded – undo
306 306
  * @category portfolio
307 307
  */   
308 308
 
309
-function lsx_portfolio_sorter(){ ?>
309
+function lsx_portfolio_sorter() { ?>
310 310
 	<ul id="filterNav" class="clearfix">
311
-		<li class="allBtn"><a href="#" data-filter="*" class="selected"><?php esc_html_e( 'All', 'lsx' ); ?></a></li>
311
+		<li class="allBtn"><a href="#" data-filter="*" class="selected"><?php esc_html_e('All', 'lsx'); ?></a></li>
312 312
 		<?php 
313 313
 		$types = get_terms('jetpack-portfolio-type');
314 314
 		
315
-		if(is_array($types)){
315
+		if (is_array($types)) {
316 316
 			foreach ($types as $type) {
317
-				$content = '<li><a href="#" data-filter=".'.$type->slug.'">';
317
+				$content = '<li><a href="#" data-filter=".' . $type->slug . '">';
318 318
 		    	$content .= $type->name;					
319 319
 				$content .= '</a></li>';
320
-				echo wp_kses_post( $content );
320
+				echo wp_kses_post($content);
321 321
 				echo "\n";
322 322
 			}
323 323
 		}?>
@@ -332,18 +332,18 @@  discard block
 block discarded – undo
332 332
  * @category portfolio
333 333
  */
334 334
 
335
-function lsx_portfolio_naviagtion_labels($labels){ 
335
+function lsx_portfolio_naviagtion_labels($labels) { 
336 336
 	
337
-	if(is_post_type_archive('jetpack-portfolio')){
337
+	if (is_post_type_archive('jetpack-portfolio')) {
338 338
 		$labels = array(
339
-				'next' 		=> '<span class="meta-nav">&larr;</span> '.esc_html__( 'Older', 'lsx' ),
340
-				'previous' 	=> esc_html__( 'Newer', 'lsx' ).' <span class="meta-nav">&rarr;</span>',
341
-				'title' 	=> esc_html__( 'Portfolio navigation', 'lsx' )
339
+				'next' 		=> '<span class="meta-nav">&larr;</span> ' . esc_html__('Older', 'lsx'),
340
+				'previous' 	=> esc_html__('Newer', 'lsx') . ' <span class="meta-nav">&rarr;</span>',
341
+				'title' 	=> esc_html__('Portfolio navigation', 'lsx')
342 342
 		);
343 343
 	}
344 344
 	return $labels;
345 345
 }
346
-add_filter('lsx_post_navigation_labels','lsx_portfolio_naviagtion_labels',1,10);
346
+add_filter('lsx_post_navigation_labels', 'lsx_portfolio_naviagtion_labels', 1, 10);
347 347
 
348 348
 
349 349
 /*
@@ -357,11 +357,11 @@  discard block
 block discarded – undo
357 357
  * @subpackage jetpack
358 358
  * @category related-posts
359 359
  */
360
-function lsx_remove_related_post_context(){
361
-	add_filter( 'jetpack_relatedposts_filter_post_context', '__return_empty_string' );
362
-	add_filter( 'rest_api_allowed_post_types', 'lsx_allowed_related_post_types' );
360
+function lsx_remove_related_post_context() {
361
+	add_filter('jetpack_relatedposts_filter_post_context', '__return_empty_string');
362
+	add_filter('rest_api_allowed_post_types', 'lsx_allowed_related_post_types');
363 363
 }
364
-add_action('init','lsx_remove_related_post_context',20);
364
+add_action('init', 'lsx_remove_related_post_context', 20);
365 365
 
366 366
 
367 367
 /*
@@ -378,13 +378,13 @@  discard block
 block discarded – undo
378 378
 	$infinite_scroll_args = array(
379 379
 			'container' => 'main',
380 380
 			'type' => 'click',
381
-			'posts_per_page' => get_option('posts_per_page',10),
381
+			'posts_per_page' => get_option('posts_per_page', 10),
382 382
 			'render'    => 'lsx_infinite_scroll_render'
383 383
 	);
384 384
 
385
-	add_theme_support( 'infinite-scroll', $infinite_scroll_args );
385
+	add_theme_support('infinite-scroll', $infinite_scroll_args);
386 386
 }
387
-add_action( 'after_setup_theme', 'lsx_jetpack_infinite_scroll_after_setup' );
387
+add_action('after_setup_theme', 'lsx_jetpack_infinite_scroll_after_setup');
388 388
 
389 389
 /**
390 390
  * Set the code to be rendered on for calling posts,
@@ -397,13 +397,13 @@  discard block
 block discarded – undo
397 397
  function lsx_infinite_scroll_render() {
398 398
 	global $wp_query;
399 399
 	
400
-	while(have_posts()){
400
+	while (have_posts()) {
401 401
 		the_post();
402 402
 		
403
-		if('jetpack-portfolio' == get_post_type()){
404
-			get_template_part( 'content', 'portfolio' );
405
-		}else{
406
-			get_template_part( 'content', get_post_type() );
403
+		if ('jetpack-portfolio' == get_post_type()) {
404
+			get_template_part('content', 'portfolio');
405
+		} else {
406
+			get_template_part('content', get_post_type());
407 407
 		}
408 408
 	}
409 409
  }
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
  * @subpackage jetpack
416 416
  * @category related posts
417 417
  */
418
-function lsx_related_posts_headline( $headline ) {
419
-	$headline = sprintf( '<h3 class="jp-relatedposts-headline"><em>%s</em></h3>', esc_html__( 'Related Posts', 'lsx' ) );
418
+function lsx_related_posts_headline($headline) {
419
+	$headline = sprintf('<h3 class="jp-relatedposts-headline"><em>%s</em></h3>', esc_html__('Related Posts', 'lsx'));
420 420
 	return $headline;
421 421
 }
422
-add_filter( 'jetpack_relatedposts_filter_headline', 'lsx_related_posts_headline' );
422
+add_filter('jetpack_relatedposts_filter_headline', 'lsx_related_posts_headline');
Please login to merge, or discard this patch.
inc/extras.php 1 patch
Spacing   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 {
@@ -484,4 +484,4 @@  discard block
 block discarded – undo
484 484
 }
485 485
 remove_filter('get_the_excerpt', 'wp_trim_excerpt');
486 486
 add_filter('get_the_excerpt', 'wpse_custom_wp_trim_excerpt');
487
-remove_filter( 'the_excerpt', 'wpautop' );
487
+remove_filter('the_excerpt', 'wpautop');
Please login to merge, or discard this patch.
content-post.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -12,20 +12,20 @@  discard block
 block discarded – undo
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,33 +39,33 @@  discard block
 block discarded – undo
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() || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) : ?>
57
+		<?php if (has_tag() || (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 ( function_exists( 'sharing_display' ) ) {
63
-						sharing_display( '', true );
62
+					if (function_exists('sharing_display')) {
63
+						sharing_display('', true);
64 64
 					}
65 65
 
66
-					if ( class_exists( 'Jetpack_Likes' ) ) {
66
+					if (class_exists('Jetpack_Likes')) {
67 67
 						$custom_likes = new Jetpack_Likes;
68
-						echo wp_kses_post( $custom_likes->post_likes( '' ) );
68
+						echo wp_kses_post($custom_likes->post_likes(''));
69 69
 					}
70 70
 				?>
71 71
 			</div>
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 
74 74
 		<?php
75 75
 			// If comments are open or we have at least one comment, load up the comment template
76
-			if ( comments_open() || '0' != get_comments_number() ) : ?>
77
-				<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>
76
+			if (comments_open() || '0' != get_comments_number()) : ?>
77
+				<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>
78 78
 
79 79
 				<div class="collapse" id="comments-collapse">
80 80
 					<?php 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		<?php endif; ?>
85 85
 	</footer><!-- .footer-meta -->
86 86
 	
87
-	<?php edit_post_link( esc_html__( 'Edit', 'lsx' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?>
87
+	<?php edit_post_link(esc_html__('Edit', 'lsx'), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>'); ?>
88 88
 
89 89
 	<?php lsx_entry_bottom(); ?>
90 90
 
Please login to merge, or discard this patch.
inc/welcome.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
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
-if ( ! function_exists( 'lsx_activation_admin_notice' ) ) :
5
+if ( ! function_exists('lsx_activation_admin_notice')) :
6 6
 	/**
7 7
 	 * Adds an admin notice upon successful activation.
8 8
 	 *
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
 	function lsx_activation_admin_notice() {
13 13
 		global $pagenow;
14 14
 
15
-		if ( is_admin() && 'themes.php' == $pagenow && isset( $_GET['activated'] ) ) {
16
-			add_action( 'admin_notices', 'lsx_welcome_admin_notice', 99 );
15
+		if (is_admin() && 'themes.php' == $pagenow && isset($_GET['activated'])) {
16
+			add_action('admin_notices', 'lsx_welcome_admin_notice', 99);
17 17
 		}
18 18
 	}
19 19
 endif; // lsx_activation_admin_notice
20
-add_action( 'load-themes.php', 'lsx_activation_admin_notice' );
20
+add_action('load-themes.php', 'lsx_activation_admin_notice');
21 21
 
22 22
 
23
-if ( ! function_exists( 'lsx_welcome_admin_notice' ) ) :
23
+if ( ! function_exists('lsx_welcome_admin_notice')) :
24 24
 	/**
25 25
 	 * Display an admin notice linking to the welcome screen.
26 26
 	 *
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
 	function lsx_welcome_admin_notice() {
31 31
 		?>
32 32
 			<div class="updated notice is-dismissible">
33
-				<p><?php echo sprintf( esc_html__( 'Thanks for choosing LSX! You can read hints and tips on how get the most out of your new theme on the %1$swelcome screen%2$s.', 'lsx' ), '<a href="' . esc_url( admin_url( 'themes.php?page=lsx-welcome' ) ) . '">', '</a>' ); ?></p>
34
-				<p><a href="<?php echo esc_url( admin_url( 'themes.php?page=lsx-welcome' ) ); ?>" class="button" style="text-decoration: none;"><?php esc_attr_e( 'Get started with LSX', 'lsx' ); ?></a></p>
33
+				<p><?php echo sprintf(esc_html__('Thanks for choosing LSX! You can read hints and tips on how get the most out of your new theme on the %1$swelcome screen%2$s.', 'lsx'), '<a href="' . esc_url(admin_url('themes.php?page=lsx-welcome')) . '">', '</a>'); ?></p>
34
+				<p><a href="<?php echo esc_url(admin_url('themes.php?page=lsx-welcome')); ?>" class="button" style="text-decoration: none;"><?php esc_attr_e('Get started with LSX', 'lsx'); ?></a></p>
35 35
 			</div>
36 36
 		<?php
37 37
 	}
38 38
 endif; // lsx_welcome_admin_notice
39 39
 
40 40
 
41
-if ( ! function_exists( 'lsx_welcome_style' ) ) :
41
+if ( ! function_exists('lsx_welcome_style')) :
42 42
 	/**
43 43
 	 * Load welcome screen css.
44 44
 	 *
@@ -46,16 +46,16 @@  discard block
 block discarded – undo
46 46
 	 * @since 1.8.0
47 47
 	 * @package lsx
48 48
 	 */
49
-	function lsx_welcome_style( $hook_suffix ) {
50
-		if ( 'appearance_page_lsx-welcome' == $hook_suffix ) {
51
-			wp_enqueue_style( 'lsx-welcome-screen', get_template_directory_uri() . '/css/admin/welcome-screen/welcome.css', array(), LSX_VERSION );
49
+	function lsx_welcome_style($hook_suffix) {
50
+		if ('appearance_page_lsx-welcome' == $hook_suffix) {
51
+			wp_enqueue_style('lsx-welcome-screen', get_template_directory_uri() . '/css/admin/welcome-screen/welcome.css', array(), LSX_VERSION);
52 52
 		}
53 53
 	}
54 54
 endif; // lsx_welcome_style
55
-add_action( 'admin_enqueue_scripts', 'lsx_welcome_style' );
55
+add_action('admin_enqueue_scripts', 'lsx_welcome_style');
56 56
 
57 57
 
58
-if ( ! function_exists( 'lsx_welcome_register_menu' ) ) :
58
+if ( ! function_exists('lsx_welcome_register_menu')) :
59 59
 	/**
60 60
 	 * Creates the dashboard page.
61 61
 	 *
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
 	 * @package lsx
64 64
 	 */
65 65
 	function lsx_welcome_register_menu() {
66
-		add_theme_page( 'LSX', 'LSX', 'activate_plugins', 'lsx-welcome', 'lsx_welcome_screen' );
66
+		add_theme_page('LSX', 'LSX', 'activate_plugins', 'lsx-welcome', 'lsx_welcome_screen');
67 67
 	}
68 68
 endif; // lsx_welcome_register_menu
69
-add_action( 'admin_menu', 'lsx_welcome_register_menu' );
69
+add_action('admin_menu', 'lsx_welcome_register_menu');
70 70
 
71 71
 
72
-if ( ! function_exists( 'lsx_welcome_screen' ) ) :
72
+if ( ! function_exists('lsx_welcome_screen')) :
73 73
 	/**
74 74
 	 * The welcome screen.
75 75
 	 *
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 	 * @package lsx
78 78
 	 */
79 79
 	function lsx_welcome_screen() {
80
-		require_once( ABSPATH . 'wp-load.php' );
81
-		require_once( ABSPATH . 'wp-admin/admin.php' );
82
-		require_once( ABSPATH . 'wp-admin/admin-header.php' );
80
+		require_once(ABSPATH . 'wp-load.php');
81
+		require_once(ABSPATH . 'wp-admin/admin.php');
82
+		require_once(ABSPATH . 'wp-admin/admin-header.php');
83 83
 		?>
84 84
 		<div class="wrap about-wrap">
85 85
 			<?php
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
 			 * @hooked lsx_welcome_enhance - 20
91 91
 			 * @hooked lsx_welcome_footer  - 30
92 92
 			 */
93
-			do_action( 'lsx_welcome' ); ?>
93
+			do_action('lsx_welcome'); ?>
94 94
 		</div>
95 95
 		<?php
96 96
 	}
97 97
 endif; // lsx_welcome_screen
98 98
 
99 99
 
100
-if ( ! function_exists( 'lsx_welcome_header' ) ) :
100
+if ( ! function_exists('lsx_welcome_header')) :
101 101
 	/**
102 102
 	 * Welcome screen intro
103 103
 	 *
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
 	 * @package lsx
106 106
 	 */
107 107
 	function lsx_welcome_header() {
108
-		require_once( get_template_directory() . '/inc/admin/welcome-screen/component-header.php' );
108
+		require_once(get_template_directory() . '/inc/admin/welcome-screen/component-header.php');
109 109
 	}
110 110
 endif; // lsx_welcome_header
111
-add_action( 'lsx_welcome', 'lsx_welcome_header', 10 );
111
+add_action('lsx_welcome', 'lsx_welcome_header', 10);
112 112
 
113 113
 
114
-if ( ! function_exists( 'lsx_welcome_enhance' ) ) :
114
+if ( ! function_exists('lsx_welcome_enhance')) :
115 115
 	/**
116 116
 	 * Welcome screen enhance section
117 117
 	 *
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
 	 * @package lsx
120 120
 	 */
121 121
 	function lsx_welcome_enhance() {
122
-		require_once( get_template_directory() . '/inc/admin/welcome-screen/component-enhance.php' );
122
+		require_once(get_template_directory() . '/inc/admin/welcome-screen/component-enhance.php');
123 123
 	}
124 124
 endif; // lsx_welcome_enhance
125
-add_action( 'lsx_welcome', 'lsx_welcome_enhance', 20 );
125
+add_action('lsx_welcome', 'lsx_welcome_enhance', 20);
126 126
 
127 127
 
128
-if ( ! function_exists( 'lsx_welcome_footer' ) ) :
128
+if ( ! function_exists('lsx_welcome_footer')) :
129 129
 	/**
130 130
 	 * Welcome screen contribute section
131 131
 	 *
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 * @package lsx
134 134
 	 */
135 135
 	function lsx_welcome_footer() {
136
-		require_once( get_template_directory() . '/inc/admin/welcome-screen/component-footer.php' );
136
+		require_once(get_template_directory() . '/inc/admin/welcome-screen/component-footer.php');
137 137
 	}
138 138
 endif; // lsx_welcome_footer
139
-add_action( 'lsx_welcome', 'lsx_welcome_footer', 30 );
139
+add_action('lsx_welcome', 'lsx_welcome_footer', 30);
Please login to merge, or discard this patch.