@@ -33,8 +33,10 @@ discard block |
||
| 33 | 33 | $paged = get_query_var( 'paged' ); |
| 34 | 34 | elseif ( get_query_var( 'page' ) ) : |
| 35 | 35 | $paged = get_query_var( 'page' ); |
| 36 | - else : |
|
| 36 | + else { |
|
| 37 | + : |
|
| 37 | 38 | $paged = 1; |
| 39 | + } |
|
| 38 | 40 | endif; |
| 39 | 41 | |
| 40 | 42 | $args = array( |
@@ -59,11 +61,14 @@ discard block |
||
| 59 | 61 | </div> |
| 60 | 62 | </div><!-- .portfolio-wrapper --> |
| 61 | 63 | |
| 62 | - <?php else : ?> |
|
| 64 | + <?php else { |
|
| 65 | + : ?> |
|
| 63 | 66 | |
| 64 | 67 | <section class="no-results not-found"> |
| 65 | 68 | <header class="page-header"> |
| 66 | - <h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'lsx' ); ?></h1> |
|
| 69 | + <h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'lsx' ); |
|
| 70 | +} |
|
| 71 | +?></h1> |
|
| 67 | 72 | </header><!-- .page-header --> |
| 68 | 73 | |
| 69 | 74 | <div class="page-content"> |
@@ -71,9 +76,12 @@ discard block |
||
| 71 | 76 | |
| 72 | 77 | <p><?php esc_html_e( 'Ready to publish your first project?', 'lsx' ); ?> <a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=jetpack-portfolio' ) ) ?>"><?php esc_html_e( 'Get started here', 'lsx' ); ?></a></p> |
| 73 | 78 | |
| 74 | - <?php else : ?> |
|
| 79 | + <?php else { |
|
| 80 | + : ?> |
|
| 75 | 81 | |
| 76 | - <p><?php esc_html_e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'lsx' ); ?></p> |
|
| 82 | + <p><?php esc_html_e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'lsx' ); |
|
| 83 | +} |
|
| 84 | +?></p> |
|
| 77 | 85 | <?php get_search_form(); ?> |
| 78 | 86 | |
| 79 | 87 | <?php endif; ?> |
@@ -1,5 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | class Lsx_Bootstrap_Navwalker extends Walker_Nav_Menu { |
| 5 | 8 | |
@@ -71,14 +74,17 @@ discard block |
||
| 71 | 74 | |
| 72 | 75 | $class_names = join( ' ', $classes ); |
| 73 | 76 | |
| 74 | - if ( $args->has_children ) |
|
| 75 | - $class_names .= ' dropdown'; |
|
| 77 | + if ( $args->has_children ) { |
|
| 78 | + $class_names .= ' dropdown'; |
|
| 79 | + } |
|
| 76 | 80 | |
| 77 | - if ( in_array( 'current-menu-item', $classes ) ) |
|
| 78 | - $class_names .= ' active'; |
|
| 81 | + if ( in_array( 'current-menu-item', $classes ) ) { |
|
| 82 | + $class_names .= ' active'; |
|
| 83 | + } |
|
| 79 | 84 | |
| 80 | - if ( in_array( 'current-menu-parent', $classes ) ) |
|
| 81 | - $class_names .= ' active'; |
|
| 85 | + if ( in_array( 'current-menu-parent', $classes ) ) { |
|
| 86 | + $class_names .= ' active'; |
|
| 87 | + } |
|
| 82 | 88 | |
| 83 | 89 | //Check if this is ment to be a "social" type menu |
| 84 | 90 | $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; |
@@ -159,14 +165,16 @@ discard block |
||
| 159 | 165 | * @return null Null on failure with no changes to parameters. |
| 160 | 166 | */ |
| 161 | 167 | public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) { |
| 162 | - if ( ! $element ) |
|
| 163 | - return; |
|
| 168 | + if ( ! $element ) { |
|
| 169 | + return; |
|
| 170 | + } |
|
| 164 | 171 | |
| 165 | 172 | $id_field = $this->db_fields['id']; |
| 166 | 173 | |
| 167 | 174 | // Display this element. |
| 168 | - if ( is_object( $args[0] ) ) |
|
| 169 | - $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] ); |
|
| 175 | + if ( is_object( $args[0] ) ) { |
|
| 176 | + $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] ); |
|
| 177 | + } |
|
| 170 | 178 | |
| 171 | 179 | parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); |
| 172 | 180 | } |
@@ -189,29 +197,34 @@ discard block |
||
| 189 | 197 | if ( $args['container'] ) { |
| 190 | 198 | $fb_output = '<' . $args['container']; |
| 191 | 199 | |
| 192 | - if ( $args['container_id'] ) |
|
| 193 | - $fb_output .= ' id="' . $args['container_id'] . '"'; |
|
| 200 | + if ( $args['container_id'] ) { |
|
| 201 | + $fb_output .= ' id="' . $args['container_id'] . '"'; |
|
| 202 | + } |
|
| 194 | 203 | |
| 195 | - if ( $args['container_class'] ) |
|
| 196 | - $fb_output .= ' class="' . $args['container_class'] . '"'; |
|
| 204 | + if ( $args['container_class'] ) { |
|
| 205 | + $fb_output .= ' class="' . $args['container_class'] . '"'; |
|
| 206 | + } |
|
| 197 | 207 | |
| 198 | 208 | $fb_output .= '>'; |
| 199 | 209 | } |
| 200 | 210 | |
| 201 | 211 | $fb_output .= '<ul'; |
| 202 | 212 | |
| 203 | - if ( $args['menu_id'] ) |
|
| 204 | - $fb_output .= ' id="' . $args['menu_id'] . '"'; |
|
| 213 | + if ( $args['menu_id'] ) { |
|
| 214 | + $fb_output .= ' id="' . $args['menu_id'] . '"'; |
|
| 215 | + } |
|
| 205 | 216 | |
| 206 | - if ( $args['menu_class'] ) |
|
| 207 | - $fb_output .= ' class="' . $args['menu_class'] . '"'; |
|
| 217 | + if ( $args['menu_class'] ) { |
|
| 218 | + $fb_output .= ' class="' . $args['menu_class'] . '"'; |
|
| 219 | + } |
|
| 208 | 220 | |
| 209 | 221 | $fb_output .= '>'; |
| 210 | 222 | $fb_output .= '<li><a href="' . admin_url( 'nav-menus.php' ) . '">' . esc_html__( 'Add a menu', 'lsx' ) . '</a></li>'; |
| 211 | 223 | $fb_output .= '</ul>'; |
| 212 | 224 | |
| 213 | - if ( $args['container'] ) |
|
| 214 | - $fb_output .= '</' . $args['container'] . '>'; |
|
| 225 | + if ( $args['container'] ) { |
|
| 226 | + $fb_output .= '</' . $args['container'] . '>'; |
|
| 227 | + } |
|
| 215 | 228 | |
| 216 | 229 | echo wp_kses_post( $fb_output ); |
| 217 | 230 | } |
@@ -243,14 +243,13 @@ discard block |
||
| 243 | 243 | |
| 244 | 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 ); |
|
| 248 | - |
|
| 249 | - elseif ( $new_meta_value && $new_meta_value != $meta_value ) |
|
| 250 | - update_post_meta( $post_id, $meta_key, $new_meta_value ); |
|
| 251 | - |
|
| 252 | - elseif ( '' == $new_meta_value && $meta_value ) |
|
| 253 | - delete_post_meta( $post_id, $meta_key, $meta_value ); |
|
| 246 | + if ( $new_meta_value && '' == $meta_value ) { |
|
| 247 | + add_post_meta( $post_id, $meta_key, $new_meta_value, true ); |
|
| 248 | + } elseif ( $new_meta_value && $new_meta_value != $meta_value ) { |
|
| 249 | + update_post_meta( $post_id, $meta_key, $new_meta_value ); |
|
| 250 | + } elseif ( '' == $new_meta_value && $meta_value ) { |
|
| 251 | + delete_post_meta( $post_id, $meta_key, $meta_value ); |
|
| 252 | + } |
|
| 254 | 253 | } |
| 255 | 254 | } |
| 256 | 255 | |
@@ -402,7 +401,7 @@ discard block |
||
| 402 | 401 | |
| 403 | 402 | if('jetpack-portfolio' == get_post_type()){ |
| 404 | 403 | get_template_part( 'content', 'portfolio' ); |
| 405 | - }else{ |
|
| 404 | + } else{ |
|
| 406 | 405 | get_template_part( 'content', get_post_type() ); |
| 407 | 406 | } |
| 408 | 407 | } |
@@ -42,9 +42,12 @@ |
||
| 42 | 42 | |
| 43 | 43 | <?php lsx_paging_nav(); ?> |
| 44 | 44 | |
| 45 | - <?php else : ?> |
|
| 45 | + <?php else { |
|
| 46 | + : ?> |
|
| 46 | 47 | |
| 47 | - <?php get_template_part( 'content', 'none' ); ?> |
|
| 48 | + <?php get_template_part( 'content', 'none' ); |
|
| 49 | +} |
|
| 50 | +?> |
|
| 48 | 51 | |
| 49 | 52 | <?php endif; $lsx_archive = 0; ?> |
| 50 | 53 | |
@@ -47,9 +47,12 @@ |
||
| 47 | 47 | |
| 48 | 48 | <?php lsx_paging_nav(); ?> |
| 49 | 49 | |
| 50 | - <?php else : ?> |
|
| 50 | + <?php else { |
|
| 51 | + : ?> |
|
| 51 | 52 | |
| 52 | - <?php get_template_part( 'content', 'none' ); ?> |
|
| 53 | + <?php get_template_part( 'content', 'none' ); |
|
| 54 | +} |
|
| 55 | +?> |
|
| 53 | 56 | |
| 54 | 57 | <?php endif; ?> |
| 55 | 58 | |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Customize Swatch Control Class |
@@ -1,5 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Enqueue scripts and styles. |
@@ -29,7 +32,7 @@ discard block |
||
| 29 | 32 | wp_enqueue_script('imagesLoaded', get_template_directory_uri().'/js/vendor/imagesloaded.pkgd.min.js', array('jquery','masonry'), LSX_VERSION); |
| 30 | 33 | if(defined('WP_DEBUG') && true === WP_DEBUG){ |
| 31 | 34 | wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.js', array('masonry'), LSX_VERSION, false); |
| 32 | - }else{ |
|
| 35 | + } else{ |
|
| 33 | 36 | wp_enqueue_script('lsx_script', get_template_directory_uri() . '/js/lsx-script.min.js', array('masonry'), LSX_VERSION, false); |
| 34 | 37 | } |
| 35 | 38 | |
@@ -107,9 +110,15 @@ discard block |
||
| 107 | 110 | */ |
| 108 | 111 | function lsx_scripts_defer_parsing( $url ) { |
| 109 | 112 | if ( ! ( is_admin() ) ) { |
| 110 | - if ( FALSE === strpos( $url, '.js' ) ) return $url; |
|
| 111 | - if ( strpos( $url, 'jquery.js' ) ) return $url; |
|
| 112 | - if ( strpos( $url, ' defer ' ) ) return $url; |
|
| 113 | + if ( FALSE === strpos( $url, '.js' ) ) { |
|
| 114 | + return $url; |
|
| 115 | + } |
|
| 116 | + if ( strpos( $url, 'jquery.js' ) ) { |
|
| 117 | + return $url; |
|
| 118 | + } |
|
| 119 | + if ( strpos( $url, ' defer ' ) ) { |
|
| 120 | + return $url; |
|
| 121 | + } |
|
| 113 | 122 | return "$url' defer onload='"; |
| 114 | 123 | } |
| 115 | 124 | |
@@ -1,5 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Enable extra attributes (srcset, sizes) in img tag |
@@ -203,10 +206,10 @@ discard block |
||
| 203 | 206 | if(false === $image_src){ |
| 204 | 207 | $post_id = get_the_ID(); |
| 205 | 208 | $post_thumbnail_id = get_post_thumbnail_id( $post_id ); |
| 206 | - }elseif(false != $image_src ){ |
|
| 209 | + } elseif(false != $image_src ){ |
|
| 207 | 210 | if(is_numeric($image_src)){ |
| 208 | 211 | $post_thumbnail_id = $image_src; |
| 209 | - }else{ |
|
| 212 | + } else{ |
|
| 210 | 213 | $post_thumbnail_id = lsx_get_attachment_id_from_src($image_src); |
| 211 | 214 | } |
| 212 | 215 | } |
@@ -334,18 +337,29 @@ discard block |
||
| 334 | 337 | $http_user_agent = ! empty( $http_user_agent ) ? $http_user_agent : ''; |
| 335 | 338 | |
| 336 | 339 | 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) { |
|
| 340 | + if($is_lynx) { |
|
| 341 | + $classes[] = 'lynx'; |
|
| 342 | + } elseif($is_gecko) { |
|
| 343 | + $classes[] = 'gecko'; |
|
| 344 | + } elseif($is_opera) { |
|
| 345 | + $classes[] = 'opera'; |
|
| 346 | + } elseif($is_ns4) { |
|
| 347 | + $classes[] = 'ns4'; |
|
| 348 | + } elseif($is_safari) { |
|
| 349 | + $classes[] = 'safari'; |
|
| 350 | + } elseif($is_chrome) { |
|
| 351 | + $classes[] = 'chrome'; |
|
| 352 | + } elseif($is_ie) { |
|
| 344 | 353 | $classes[] = 'ie'; |
| 345 | - if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $http_user_agent, $browser_version)) |
|
| 346 | - $classes[] = 'ie'.$browser_version[1]; |
|
| 347 | - } else $classes[] = 'unknown'; |
|
| 348 | - if($is_iphone) $classes[] = 'iphone'; |
|
| 354 | + if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $http_user_agent, $browser_version)) { |
|
| 355 | + $classes[] = 'ie'.$browser_version[1]; |
|
| 356 | + } |
|
| 357 | + } else { |
|
| 358 | + $classes[] = 'unknown'; |
|
| 359 | + } |
|
| 360 | + if($is_iphone) { |
|
| 361 | + $classes[] = 'iphone'; |
|
| 362 | + } |
|
| 349 | 363 | if ( stristr( $http_user_agent, "mac") ) { |
| 350 | 364 | $classes[] = 'osx'; |
| 351 | 365 | } elseif ( stristr( $http_user_agent, "linux") ) { |
@@ -403,8 +417,7 @@ discard block |
||
| 403 | 417 | |
| 404 | 418 | if ( ! empty( $pagination ) ) { |
| 405 | 419 | $excerpt .= $pagination; |
| 406 | - } |
|
| 407 | - else { |
|
| 420 | + } else { |
|
| 408 | 421 | $excerpt .= '<p><a class="moretag" href="'.get_permalink().'">'.esc_html__('Continue reading','lsx').'</a></p>'; |
| 409 | 422 | } |
| 410 | 423 | } |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | |
| 5 | 8 | if ( ! function_exists( 'lsx_activation_admin_notice' ) ) : |