@@ -5,6 +5,7 @@ |
||
5 | 5 | * Layout hooks |
6 | 6 | * |
7 | 7 | * @package lsx |
8 | + * @param string $class |
|
8 | 9 | */ |
9 | 10 | |
10 | 11 | function lsx_layout_selector( $class, $area = 'site' ) { |
@@ -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 | * Layout hooks |
@@ -62,7 +65,7 @@ discard block |
||
62 | 65 | $show_on_front = get_option('show_on_front'); |
63 | 66 | if('page' == $show_on_front){ |
64 | 67 | return lsx_layout_selector( 'main', 'home' ); |
65 | - }else{ |
|
68 | + } else{ |
|
66 | 69 | return lsx_layout_selector( 'main', 'site' ); |
67 | 70 | } |
68 | 71 |
@@ -140,6 +140,9 @@ |
||
140 | 140 | return self::$noscripts[(int) $match[1]]; |
141 | 141 | } |
142 | 142 | |
143 | + /** |
|
144 | + * @param string $new_class |
|
145 | + */ |
|
143 | 146 | static function add_class( $html_string = '', $new_class ) { |
144 | 147 | $pattern = '/class=[\'"]([^\'"]*)[\'"]/'; |
145 | 148 |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
3 | 5 | |
4 | 6 | /* |
5 | 7 | * LSX Lazy Load Images Class |
@@ -25,8 +27,9 @@ discard block |
||
25 | 27 | protected static $noscripts = array(); |
26 | 28 | |
27 | 29 | static function init() { |
28 | - if ( is_admin() ) |
|
29 | - return; |
|
30 | + if ( is_admin() ) { |
|
31 | + return; |
|
32 | + } |
|
30 | 33 | |
31 | 34 | if ( get_theme_mod( 'lsx_lazyload_status', '1' ) === false ) { |
32 | 35 | self::$enabled = false; |
@@ -97,7 +97,7 @@ |
||
97 | 97 | * @subpackage sanitize |
98 | 98 | * |
99 | 99 | * @param array $input |
100 | - * @return array $output |
|
100 | + * @return string|false $output |
|
101 | 101 | */ |
102 | 102 | function lsx_sanitize_checkbox( $input ) { |
103 | 103 | if ( $input ) { |
@@ -7,7 +7,6 @@ discard block |
||
7 | 7 | * @author Novrian <[email protected]> |
8 | 8 | * @copyright (c) 2013. Novrian Y.F. |
9 | 9 | * @license MIT License |
10 | - * @param string $sep Your custom separator |
|
11 | 10 | */ |
12 | 11 | function lsx_breadcrumbs() { |
13 | 12 | if (!function_exists('yoast_breadcrumb') && !function_exists('woocommerce_breadcrumb')) { |
@@ -262,7 +261,7 @@ discard block |
||
262 | 261 | /** |
263 | 262 | * Display navigation to next/previous set of posts when applicable. |
264 | 263 | * |
265 | - * @return void |
|
264 | + * @return null|boolean |
|
266 | 265 | */ |
267 | 266 | function lsx_paging_nav() { |
268 | 267 | // Don't print empty markup if there's only one page. |
@@ -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 | * Yoast Breadcrumbs on Twitter Bootstrap |
@@ -24,7 +27,7 @@ discard block |
||
24 | 27 | woocommerce_breadcrumb(); |
25 | 28 | $output = ob_get_clean(); |
26 | 29 | $output = str_replace('woocommerce-breadcrumb', 'woocommerce-breadcrumb breadcrumbs-container', $output); |
27 | - }elseif(function_exists('yoast_breadcrumb')){ |
|
30 | + } elseif(function_exists('yoast_breadcrumb')){ |
|
28 | 31 | // Default Yoast Breadcrumbs Separator |
29 | 32 | $old_sep = '\»\;'; |
30 | 33 | |
@@ -326,9 +329,9 @@ discard block |
||
326 | 329 | |
327 | 330 | if(current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')){ |
328 | 331 | return true; |
329 | - }elseif(function_exists('wp_pagenavi')){ |
|
332 | + } elseif(function_exists('wp_pagenavi')){ |
|
330 | 333 | wp_pagenavi(); |
331 | - }else{ |
|
334 | + } else{ |
|
332 | 335 | |
333 | 336 | $labels = array( |
334 | 337 | 'next' => '<span class="meta-nav">←</span> '.esc_html__( 'Older posts', 'lsx' ), |
@@ -406,9 +409,9 @@ discard block |
||
406 | 409 | |
407 | 410 | if ( function_exists('has_custom_logo') && has_custom_logo() ) { |
408 | 411 | the_custom_logo(); |
409 | - }elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { |
|
412 | + } elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { |
|
410 | 413 | jetpack_the_site_logo(); |
411 | - }else{ |
|
414 | + } else{ |
|
412 | 415 | // shouldn't show both together.. its just strange |
413 | 416 | if(true == get_theme_mod('site_logo_header_text',1)){ |
414 | 417 | lsx_site_title(); |
@@ -534,7 +537,7 @@ discard block |
||
534 | 537 | $post_type_object = get_post_type_object($post_type); |
535 | 538 | if(null != $post_type_object){ |
536 | 539 | $title = $post_type_object->labels->name; |
537 | - }else{ |
|
540 | + } else{ |
|
538 | 541 | $title = ucwords($post_type); |
539 | 542 | } |
540 | 543 | |
@@ -689,8 +692,9 @@ discard block |
||
689 | 692 | * @category urls |
690 | 693 | */ |
691 | 694 | function lsx_get_my_url() { |
692 | - if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) |
|
693 | - return false; |
|
695 | + if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) { |
|
696 | + return false; |
|
697 | + } |
|
694 | 698 | |
695 | 699 | return esc_url_raw( $matches[1] ); |
696 | 700 | } |
@@ -707,14 +711,14 @@ discard block |
||
707 | 711 | $part = (string) $part; |
708 | 712 | if ( '' !== $part ){ |
709 | 713 | $template = "{$slug}-{$part}.php"; |
710 | - }else{ |
|
714 | + } else{ |
|
711 | 715 | $template = "{$slug}.php"; |
712 | 716 | } |
713 | 717 | $file_path = apply_filters('lsx_content_path',false,$slug,$part); |
714 | 718 | |
715 | 719 | if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) { |
716 | 720 | load_template( $file_path.$template, false ); |
717 | - }else{ |
|
721 | + } else{ |
|
718 | 722 | get_template_part($slug,$part); |
719 | 723 | } |
720 | 724 | } |
721 | 725 | \ No newline at end of file |
@@ -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 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | if('posts' == $show_on_front && is_home()){ |
24 | 24 | $sidebar = 'home'; |
25 | - }else{ |
|
25 | + } else{ |
|
26 | 26 | $sidebar = 'sidebar-1'; |
27 | 27 | } |
28 | 28 | } |
@@ -38,9 +38,12 @@ discard block |
||
38 | 38 | |
39 | 39 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary"> |
40 | 40 | |
41 | - <?php else : ?> |
|
41 | + <?php else { |
|
42 | + : ?> |
|
42 | 43 | |
43 | - <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary"> |
|
44 | + <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); |
|
45 | +} |
|
46 | +?>" role="complementary"> |
|
44 | 47 | |
45 | 48 | <?php endif ; ?> |
46 | 49 |
@@ -12,7 +12,7 @@ |
||
12 | 12 | $layout = get_theme_mod('lsx_layout','2cr'); |
13 | 13 | if('posts' == $show_on_front && is_home()){ |
14 | 14 | $sidebar = 'home'; |
15 | - }else{ |
|
15 | + } else{ |
|
16 | 16 | $sidebar = 'sidebar-1'; |
17 | 17 | } |
18 | 18 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | if(has_nav_menu('footer-menu')){ |
26 | 26 | wp_nav_menu(array('theme_location' => 'footer-menu')); |
27 | 27 | } |
28 | - }else{ |
|
28 | + } else{ |
|
29 | 29 | if(has_nav_menu('footer_logged_in')){ |
30 | 30 | wp_nav_menu(array('theme_location' => 'footer_logged_in')); |
31 | 31 | } |
@@ -62,18 +62,20 @@ |
||
62 | 62 | */ |
63 | 63 | $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); |
64 | 64 | foreach ( $attachments as $k => $attachment ) { |
65 | - if ( $attachment->ID == $post->ID ) |
|
66 | - break; |
|
65 | + if ( $attachment->ID == $post->ID ) { |
|
66 | + break; |
|
67 | + } |
|
67 | 68 | } |
68 | 69 | $k++; |
69 | 70 | // If there is more than 1 attachment in a gallery |
70 | 71 | if ( count( $attachments ) > 1 ) { |
71 | - if ( isset( $attachments[ $k ] ) ) |
|
72 | - // get the URL of the next image attachment |
|
72 | + if ( isset( $attachments[ $k ] ) ) { |
|
73 | + // get the URL of the next image attachment |
|
73 | 74 | $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); |
74 | - else |
|
75 | - // or get the URL of the first image attachment |
|
75 | + } else { |
|
76 | + // or get the URL of the first image attachment |
|
76 | 77 | $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); |
78 | + } |
|
77 | 79 | } else { |
78 | 80 | // or, if there's only 1 image, get the URL of the image |
79 | 81 | $next_attachment_url = wp_get_attachment_url(); |