@@ -12,26 +12,26 @@ discard block |
||
12 | 12 | * Hooks |
13 | 13 | */ |
14 | 14 | |
15 | -remove_action( 'sensei_before_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper' ), 10 ); |
|
16 | -remove_action( 'sensei_after_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper_end' ), 10 ); |
|
15 | +remove_action('sensei_before_main_content', array($woothemes_sensei->frontend, 'sensei_output_content_wrapper'), 10); |
|
16 | +remove_action('sensei_after_main_content', array($woothemes_sensei->frontend, 'sensei_output_content_wrapper_end'), 10); |
|
17 | 17 | |
18 | 18 | add_action('sensei_before_main_content', 'lsx_sensei_before_content', 10); |
19 | 19 | add_action('sensei_after_main_content', 'lsx_sensei_after_content', 10); |
20 | 20 | |
21 | 21 | //Switching the course filters and the headers around |
22 | -remove_action('sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 10, 0 ); |
|
23 | -remove_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_sorting' ) ); |
|
24 | -remove_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_filters' ) ); |
|
25 | -add_action('sensei_archive_before_course_loop', array( 'Sensei_Course', 'archive_header' ), 11, 0 ); |
|
26 | -add_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_sorting' ),12 ); |
|
27 | -add_action ( 'sensei_archive_before_course_loop' , array( 'Sensei_Course', 'course_archive_filters' ),12 ); |
|
22 | +remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 10, 0); |
|
23 | +remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting')); |
|
24 | +remove_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters')); |
|
25 | +add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'archive_header'), 11, 0); |
|
26 | +add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_sorting'), 12); |
|
27 | +add_action('sensei_archive_before_course_loop', array('Sensei_Course', 'course_archive_filters'), 12); |
|
28 | 28 | |
29 | 29 | // Moving course image up in DOM |
30 | -remove_action('sensei_course_content_inside_before', array( Sensei()->course, 'course_image' ) ,10, 1 ); |
|
31 | -add_action('sensei_course_content_inside_before', array( Sensei()->course, 'course_image' ) ,1, 1 ); |
|
30 | +remove_action('sensei_course_content_inside_before', array(Sensei()->course, 'course_image'), 10, 1); |
|
31 | +add_action('sensei_course_content_inside_before', array(Sensei()->course, 'course_image'), 1, 1); |
|
32 | 32 | |
33 | -remove_action( 'sensei_single_course_content_inside_before', array( Sensei()->course , 'course_image'), 20 ); |
|
34 | -add_action( 'sensei_single_course_content_inside_before', array( Sensei()->course , 'course_image'), 12 ); |
|
33 | +remove_action('sensei_single_course_content_inside_before', array(Sensei()->course, 'course_image'), 20); |
|
34 | +add_action('sensei_single_course_content_inside_before', array(Sensei()->course, 'course_image'), 12); |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Adds the top and primary divs for the layout. |
@@ -39,22 +39,22 @@ discard block |
||
39 | 39 | * @subpackage sensei |
40 | 40 | * @category layout |
41 | 41 | */ |
42 | -function lsx_sensei_wp_head(){ |
|
42 | +function lsx_sensei_wp_head() { |
|
43 | 43 | |
44 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
45 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
44 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
45 | + $layout = apply_filters('lsx_layout', $layout); |
|
46 | 46 | |
47 | - if('1c' === $layout && is_post_type_archive(array('course','lesson'))) { |
|
48 | - add_action('sensei_archive_before_course_loop', 'lsx_breadcrumbs', 11 ); |
|
47 | + if ('1c' === $layout && is_post_type_archive(array('course', 'lesson'))) { |
|
48 | + add_action('sensei_archive_before_course_loop', 'lsx_breadcrumbs', 11); |
|
49 | 49 | } |
50 | 50 | |
51 | - if('1c' === $layout && is_tax(array('module','course-category'))) { |
|
51 | + if ('1c' === $layout && is_tax(array('module', 'course-category'))) { |
|
52 | 52 | remove_action('lsx_content_top', 'lsx_breadcrumbs'); |
53 | - add_action( 'sensei_loop_course_before', 'lsx_breadcrumbs', 80 , 1 ); |
|
53 | + add_action('sensei_loop_course_before', 'lsx_breadcrumbs', 80, 1); |
|
54 | 54 | |
55 | - if(is_tax('module')){ |
|
56 | - remove_action( 'sensei_content_lesson_inside_before', array( 'Sensei_Lesson', 'the_lesson_meta' ), 20 ); |
|
57 | - add_action( 'sensei_content_lesson_inside_before', array( 'Sensei_Lesson', 'the_lesson_meta' ), 40 ); |
|
55 | + if (is_tax('module')) { |
|
56 | + remove_action('sensei_content_lesson_inside_before', array('Sensei_Lesson', 'the_lesson_meta'), 20); |
|
57 | + add_action('sensei_content_lesson_inside_before', array('Sensei_Lesson', 'the_lesson_meta'), 40); |
|
58 | 58 | |
59 | 59 | remove_action('sensei_content_lesson_inside_before', array('Sensei_Core_Modules', 'module_archive_description'), 11); |
60 | 60 | } |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | * @subpackage sensei |
74 | 74 | * @category layout |
75 | 75 | */ |
76 | -function lsx_sensei_before_content(){ ?> |
|
76 | +function lsx_sensei_before_content() { ?> |
|
77 | 77 | <?php lsx_content_wrap_before(); ?> |
78 | 78 | |
79 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
79 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
80 | 80 | |
81 | 81 | <?php lsx_content_before(); ?> |
82 | 82 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @subpackage sensei |
93 | 93 | * @category layout |
94 | 94 | */ |
95 | -function lsx_sensei_after_content(){ ?> |
|
95 | +function lsx_sensei_after_content() { ?> |
|
96 | 96 | <?php lsx_content_bottom(); ?> |
97 | 97 | |
98 | 98 | </main><!-- #main --> |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @subpackage sensei |
117 | 117 | * @category redirect |
118 | 118 | */ |
119 | -add_filter( 'sensei_disable_styles', '__return_true' ); |
|
119 | +add_filter('sensei_disable_styles', '__return_true'); |
|
120 | 120 | |
121 | 121 | /** |
122 | 122 | * Includes the sensei specific styles. |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | * @category styles |
126 | 126 | */ |
127 | 127 | function lsx_sensei_styles() { |
128 | - wp_enqueue_style( 'sensei', get_template_directory_uri() . '/css/sensei.css', array(), LSX_VERSION ); |
|
128 | + wp_enqueue_style('sensei', get_template_directory_uri() . '/css/sensei.css', array(), LSX_VERSION); |
|
129 | 129 | } |
130 | -add_action( 'wp_enqueue_scripts', 'lsx_sensei_styles' ); |
|
130 | +add_action('wp_enqueue_scripts', 'lsx_sensei_styles'); |
|
131 | 131 | |
132 | 132 | /** |
133 | 133 | * Redirects Lessons Archive to Courses Overview |
@@ -135,13 +135,13 @@ discard block |
||
135 | 135 | * @subpackage woocommerce |
136 | 136 | * @category styles |
137 | 137 | */ |
138 | -function lsx_sensei_redirect_to_home( $query ){ |
|
139 | - if ( ! is_admin() && is_post_type_archive( 'lesson' ) && $query->is_main_query() ) { |
|
140 | - wp_redirect( home_url() . '/courses-overview' ); |
|
138 | +function lsx_sensei_redirect_to_home($query) { |
|
139 | + if ( ! is_admin() && is_post_type_archive('lesson') && $query->is_main_query()) { |
|
140 | + wp_redirect(home_url() . '/courses-overview'); |
|
141 | 141 | exit; |
142 | 142 | } |
143 | 143 | } |
144 | -add_action( 'parse_query', 'lsx_sensei_redirect_to_home' ); |
|
144 | +add_action('parse_query', 'lsx_sensei_redirect_to_home'); |
|
145 | 145 | |
146 | 146 | /** |
147 | 147 | * Filters the archive title |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | * @subpackage woocommerce |
150 | 150 | * @category styles |
151 | 151 | */ |
152 | -function lsx_sensei_category_title( $html,$term_id ){ |
|
153 | - $html = str_replace('h2','h1',$html); |
|
154 | - $html = str_replace('sensei-category-title','archive-title',$html); |
|
152 | +function lsx_sensei_category_title($html, $term_id) { |
|
153 | + $html = str_replace('h2', 'h1', $html); |
|
154 | + $html = str_replace('sensei-category-title', 'archive-title', $html); |
|
155 | 155 | |
156 | - return '<header class="archive-header">'.$html.'</header>'; |
|
156 | + return '<header class="archive-header">' . $html . '</header>'; |
|
157 | 157 | } |
158 | -add_filter( 'course_category_title', 'lsx_sensei_category_title',1,10 ); |
|
159 | 158 | \ No newline at end of file |
159 | +add_filter('course_category_title', 'lsx_sensei_category_title', 1, 10); |
|
160 | 160 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Theme Configuration File |
@@ -8,7 +8,7 @@ discard block |
||
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 |
||
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,68 +28,68 @@ discard block |
||
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 (right)' , 'lsx' ), |
|
50 | - 'top-menu-left'=> esc_html__( 'Top Menu (left)' , 'lsx' ), |
|
51 | - 'social'=> esc_html__( 'Social Menu' , 'lsx' ), |
|
52 | - 'footer'=> esc_html__( 'Footer Menu' , 'lsx' ) |
|
53 | - ) ); |
|
47 | + register_nav_menus(array( |
|
48 | + 'primary' => esc_html__('Primary Menu', 'lsx'), |
|
49 | + 'top-menu'=> esc_html__('Top Menu (right)', 'lsx'), |
|
50 | + 'top-menu-left'=> esc_html__('Top Menu (left)', 'lsx'), |
|
51 | + 'social'=> esc_html__('Social Menu', 'lsx'), |
|
52 | + 'footer'=> esc_html__('Footer Menu', 'lsx') |
|
53 | + )); |
|
54 | 54 | |
55 | 55 | //Set the content width |
56 | 56 | $content_width = 1140; |
57 | 57 | |
58 | - add_editor_style( get_template_directory_uri() . '/css/editor-style.css' ); |
|
59 | - add_theme_support( 'html5', array( 'caption' ) ); |
|
58 | + add_editor_style(get_template_directory_uri() . '/css/editor-style.css'); |
|
59 | + add_theme_support('html5', array('caption')); |
|
60 | 60 | |
61 | - add_theme_support( 'woocommerce' ); |
|
62 | - add_theme_support( 'sensei' ); |
|
61 | + add_theme_support('woocommerce'); |
|
62 | + add_theme_support('sensei'); |
|
63 | 63 | |
64 | - add_theme_support( 'starter-content', array( |
|
64 | + add_theme_support('starter-content', array( |
|
65 | 65 | 'widgets' => array( |
66 | 66 | 'sidebar-home' => array( |
67 | 67 | 'custom_widget_1' => array( |
68 | 68 | 'text', |
69 | 69 | array( |
70 | 70 | 'title' => '', |
71 | - 'text' => wp_kses_post( '<div class="lsx-full-width"><div class="row"><div class="col-sm-6"><h3>Full Width Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros.</p><p><a href="#" class="btn cta-btn">Lorem ipsum</a></p></div><div class="col-sm-6"><h3>Full Width Widget</h3><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros.</p></div></div></div>' ), |
|
71 | + 'text' => wp_kses_post('<div class="lsx-full-width"><div class="row"><div class="col-sm-6"><h3>Full Width Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros.</p><p><a href="#" class="btn cta-btn">Lorem ipsum</a></p></div><div class="col-sm-6"><h3>Full Width Widget</h3><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros.</p></div></div></div>'), |
|
72 | 72 | ) |
73 | 73 | ), |
74 | 74 | 'custom_widget_2' => array( |
75 | 75 | 'text', |
76 | 76 | array( |
77 | 77 | 'title' => '', |
78 | - 'text' => wp_kses_post( '<div class="row"><div class="col-sm-6"><h3 style="margin-top:0">Text Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros.</p></div><div class="col-sm-6"><h3 style="margin-top:0">Text Widget</h3><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque <a href="#">volutpat mattis eros</a>.</p></div></div>' ), |
|
78 | + 'text' => wp_kses_post('<div class="row"><div class="col-sm-6"><h3 style="margin-top:0">Text Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros.</p></div><div class="col-sm-6"><h3 style="margin-top:0">Text Widget</h3><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque <a href="#">volutpat mattis eros</a>.</p></div></div>'), |
|
79 | 79 | ) |
80 | 80 | ), |
81 | 81 | 'custom_widget_3' => array( |
82 | 82 | 'text', |
83 | 83 | array( |
84 | 84 | 'title' => '', |
85 | - 'text' => wp_kses_post( '<div class="lsx-full-width-alt"><div class="row"><div class="col-sm-6"><h3>Full Width CTA Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros.</p><p><a href="#" class="btn cta-btn">Lorem ipsum</a></p></div><div class="col-sm-6"><h3>Full Width CTA Widget</h3><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros.</p><p><a href="#" class="btn">Lorem ipsum</a></p></div></div></div>' ), |
|
85 | + 'text' => wp_kses_post('<div class="lsx-full-width-alt"><div class="row"><div class="col-sm-6"><h3>Full Width CTA Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros.</p><p><a href="#" class="btn cta-btn">Lorem ipsum</a></p></div><div class="col-sm-6"><h3>Full Width CTA Widget</h3><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros.</p><p><a href="#" class="btn">Lorem ipsum</a></p></div></div></div>'), |
|
86 | 86 | ) |
87 | 87 | ), |
88 | 88 | 'custom_widget_4' => array( |
89 | 89 | 'text', |
90 | 90 | array( |
91 | 91 | 'title' => '', |
92 | - 'text' => wp_kses_post( '<div class="row"><div class="col-sm-12"><h3 style="margin-top:0">Text Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.</p></div></div>' ), |
|
92 | + 'text' => wp_kses_post('<div class="row"><div class="col-sm-12"><h3 style="margin-top:0">Text Widget</h3><p>Lorem ipsum dolor sit amet, <a href="#">consectetuer adipiscing elit</a>. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.</p></div></div>'), |
|
93 | 93 | ) |
94 | 94 | ), |
95 | 95 | ), |
@@ -98,22 +98,22 @@ discard block |
||
98 | 98 | 'custom_widget_1' => array( |
99 | 99 | 'text', |
100 | 100 | array( |
101 | - 'title' => esc_html__( 'Footer Widget', 'lsx' ), |
|
102 | - 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae ipsum nec sapien consectetur convallis eu sit amet diam. Praesent dignissim vel arcu et gravida.', 'lsx' ), |
|
101 | + 'title' => esc_html__('Footer Widget', 'lsx'), |
|
102 | + 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae ipsum nec sapien consectetur convallis eu sit amet diam. Praesent dignissim vel arcu et gravida.', 'lsx'), |
|
103 | 103 | ) |
104 | 104 | ), |
105 | 105 | 'custom_widget_2' => array( |
106 | 106 | 'text', |
107 | 107 | array( |
108 | - 'title' => esc_html__( 'Footer Widget', 'lsx' ), |
|
109 | - 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae ipsum nec sapien consectetur convallis eu sit amet diam. Praesent dignissim vel arcu et gravida.', 'lsx' ), |
|
108 | + 'title' => esc_html__('Footer Widget', 'lsx'), |
|
109 | + 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae ipsum nec sapien consectetur convallis eu sit amet diam. Praesent dignissim vel arcu et gravida.', 'lsx'), |
|
110 | 110 | ) |
111 | 111 | ), |
112 | 112 | 'custom_widget_3' => array( |
113 | 113 | 'text', |
114 | 114 | array( |
115 | - 'title' => esc_html__( 'Footer Widget', 'lsx' ), |
|
116 | - 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae ipsum nec sapien consectetur convallis eu sit amet diam. Praesent dignissim vel arcu et gravida.', 'lsx' ), |
|
115 | + 'title' => esc_html__('Footer Widget', 'lsx'), |
|
116 | + 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae ipsum nec sapien consectetur convallis eu sit amet diam. Praesent dignissim vel arcu et gravida.', 'lsx'), |
|
117 | 117 | ) |
118 | 118 | ), |
119 | 119 | ), |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | 'custom_widget_1' => array( |
123 | 123 | 'text', |
124 | 124 | array( |
125 | - 'title' => esc_html__( 'Footer Call to Action Widget', 'lsx' ), |
|
126 | - 'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.', 'lsx' ), |
|
125 | + 'title' => esc_html__('Footer Call to Action Widget', 'lsx'), |
|
126 | + 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.', 'lsx'), |
|
127 | 127 | ) |
128 | 128 | ), |
129 | 129 | ), |
@@ -149,15 +149,15 @@ discard block |
||
149 | 149 | |
150 | 150 | 'attachments' => array( |
151 | 151 | 'image-banner-placeholder-01' => array( |
152 | - 'post_title' => esc_html_x( 'Banner Placeholder 01', 'Theme starter content', 'lsx' ), |
|
152 | + 'post_title' => esc_html_x('Banner Placeholder 01', 'Theme starter content', 'lsx'), |
|
153 | 153 | 'file' => 'img/banner-placeholder-01.jpg', |
154 | 154 | ), |
155 | 155 | 'image-banner-placeholder-02' => array( |
156 | - 'post_title' => esc_html_x( 'Banner Placeholder 02', 'Theme starter content', 'lsx' ), |
|
156 | + 'post_title' => esc_html_x('Banner Placeholder 02', 'Theme starter content', 'lsx'), |
|
157 | 157 | 'file' => 'img/banner-placeholder-02.jpg', |
158 | 158 | ), |
159 | 159 | 'image-banner-placeholder-03' => array( |
160 | - 'post_title' => esc_html_x( 'Banner Placeholder 03', 'Theme starter content', 'lsx' ), |
|
160 | + 'post_title' => esc_html_x('Banner Placeholder 03', 'Theme starter content', 'lsx'), |
|
161 | 161 | 'file' => 'img/banner-placeholder-03.jpg', |
162 | 162 | ), |
163 | 163 | ), |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | 'nav_menus' => array( |
172 | 172 | 'primary' => array( |
173 | - 'name' => esc_html__( 'Primary Menu', 'lsx' ), |
|
173 | + 'name' => esc_html__('Primary Menu', 'lsx'), |
|
174 | 174 | 'items' => array( |
175 | 175 | 'page_home', |
176 | 176 | 'page_about', |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | ), |
180 | 180 | ), |
181 | 181 | 'top-menu' => array( |
182 | - 'name' => esc_html__( 'Top Menu', 'lsx' ), |
|
182 | + 'name' => esc_html__('Top Menu', 'lsx'), |
|
183 | 183 | 'items' => array( |
184 | 184 | 'custom_link_1' => array( |
185 | 185 | 'title' => 'View Map', |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | ), |
203 | 203 | ), |
204 | 204 | 'social' => array( |
205 | - 'name' => esc_html__( 'Social Menu', 'lsx' ), |
|
205 | + 'name' => esc_html__('Social Menu', 'lsx'), |
|
206 | 206 | 'items' => array( |
207 | 207 | 'link_facebook', |
208 | 208 | 'link_foursquare', |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | ), |
216 | 216 | ), |
217 | 217 | 'footer' => array( |
218 | - 'name' => esc_html__( 'Footer Menu', 'lsx' ), |
|
218 | + 'name' => esc_html__('Footer Menu', 'lsx'), |
|
219 | 219 | 'items' => array( |
220 | 220 | 'page_about', |
221 | 221 | 'page_contact', |
@@ -228,21 +228,21 @@ discard block |
||
228 | 228 | 'lsx_header_search' => '1', |
229 | 229 | 'lsx_layout' => '1c', |
230 | 230 | ), |
231 | - ) ); |
|
231 | + )); |
|
232 | 232 | } |
233 | 233 | endif; // lsx_setup |
234 | -add_action( 'after_setup_theme', 'lsx_setup' ); |
|
234 | +add_action('after_setup_theme', 'lsx_setup'); |
|
235 | 235 | |
236 | 236 | /** |
237 | 237 | * Removes the "Custom Fields" meta box. |
238 | 238 | */ |
239 | 239 | function lsx_remove_meta_boxes() { |
240 | 240 | $post_types = get_post_types(); |
241 | - foreach($post_types as $post_type){ |
|
242 | - remove_meta_box( 'postcustom' , $post_type , 'normal' ); |
|
241 | + foreach ($post_types as $post_type) { |
|
242 | + remove_meta_box('postcustom', $post_type, 'normal'); |
|
243 | 243 | } |
244 | 244 | } |
245 | -add_action( 'admin_menu' , 'lsx_remove_meta_boxes' ); |
|
245 | +add_action('admin_menu', 'lsx_remove_meta_boxes'); |
|
246 | 246 | |
247 | 247 | /** |
248 | 248 | * Overwrite the $content_width var, based on the layout of the page. |
@@ -254,33 +254,33 @@ discard block |
||
254 | 254 | function lsx_process_content_width() { |
255 | 255 | global $content_width; |
256 | 256 | |
257 | - if( |
|
257 | + if ( |
|
258 | 258 | is_page_template('page-templates/template-portfolio.php') || |
259 | 259 | is_page_template('page-templates/template-front-page.php') || |
260 | 260 | is_page_template('page-templates/template-full-width.php') || |
261 | 261 | is_post_type_archive('jetpack-portfolio') || |
262 | - is_tax(array('jetpack-portfolio-type','jetpack-portfolio-tag')) || |
|
262 | + is_tax(array('jetpack-portfolio-type', 'jetpack-portfolio-tag')) || |
|
263 | 263 | is_singular('jetpack-portfolio') |
264 | - ){ |
|
264 | + ) { |
|
265 | 265 | $content_width = 1140; |
266 | 266 | } |
267 | 267 | } |
268 | -add_action('wp_head','lsx_process_content_width'); |
|
268 | +add_action('wp_head', 'lsx_process_content_width'); |
|
269 | 269 | |
270 | 270 | /** |
271 | 271 | * Disable the comments form by default for the page post type. |
272 | 272 | * @package lsx |
273 | 273 | * @subpackage config |
274 | 274 | */ |
275 | -function lsx_page_comments_off( $data ) { |
|
276 | - if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) { |
|
275 | +function lsx_page_comments_off($data) { |
|
276 | + if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) { |
|
277 | 277 | $data['comment_status'] = 0; |
278 | 278 | $data['ping_status'] = 0; |
279 | 279 | } |
280 | 280 | |
281 | 281 | return $data; |
282 | 282 | } |
283 | -add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' ); |
|
283 | +add_filter('wp_insert_post_data', 'lsx_page_comments_off'); |
|
284 | 284 | |
285 | 285 | /** |
286 | 286 | * Disable the comments form by default for the page post type. |
@@ -288,14 +288,14 @@ discard block |
||
288 | 288 | * @subpackage config |
289 | 289 | */ |
290 | 290 | function lsx_is_legacy($data) { |
291 | - if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) { |
|
291 | + if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) { |
|
292 | 292 | $data['comment_status'] = 0; |
293 | 293 | $data['ping_status'] = 0; |
294 | 294 | } |
295 | 295 | |
296 | 296 | return $data; |
297 | 297 | } |
298 | -add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' ); |
|
298 | +add_filter('wp_insert_post_data', 'lsx_page_comments_off'); |
|
299 | 299 | |
300 | 300 | /** |
301 | 301 | * Run the init command |
@@ -303,11 +303,11 @@ discard block |
||
303 | 303 | * @subpackage config |
304 | 304 | */ |
305 | 305 | function lsx_init() { |
306 | - if(class_exists('WooCommerce')){ |
|
307 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 ); |
|
306 | + if (class_exists('WooCommerce')) { |
|
307 | + remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0); |
|
308 | 308 | } |
309 | 309 | } |
310 | -add_action( 'init', 'lsx_init',100 ); |
|
310 | +add_action('init', 'lsx_init', 100); |
|
311 | 311 | |
312 | 312 | /** |
313 | 313 | * Run on the wp_head |
@@ -316,11 +316,11 @@ discard block |
||
316 | 316 | */ |
317 | 317 | function lsx_wp_head() { |
318 | 318 | |
319 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
320 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
319 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
320 | + $layout = apply_filters('lsx_layout', $layout); |
|
321 | 321 | |
322 | - 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')) ){ |
|
323 | - remove_action('lsx_content_top', 'lsx_breadcrumbs', 100 ); |
|
322 | + 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'))) { |
|
323 | + remove_action('lsx_content_top', 'lsx_breadcrumbs', 100); |
|
324 | 324 | } |
325 | 325 | } |
326 | -add_action( 'wp_head', 'lsx_wp_head',100 ); |
|
326 | +add_action('wp_head', 'lsx_wp_head', 100); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | <?php lsx_content_wrap_before(); ?> |
11 | 11 | |
12 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
12 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
13 | 13 | |
14 | 14 | <?php lsx_content_before(); ?> |
15 | 15 | |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | |
18 | 18 | <?php lsx_content_top(); ?> |
19 | 19 | |
20 | - <?php while ( have_posts() ) : the_post(); ?> |
|
20 | + <?php while (have_posts()) : the_post(); ?> |
|
21 | 21 | |
22 | - <?php get_template_part( 'content', get_post_type() ); ?> |
|
22 | + <?php get_template_part('content', get_post_type()); ?> |
|
23 | 23 | |
24 | 24 | <?php endwhile; // end of the loop. ?> |
25 | 25 | |
@@ -35,6 +35,6 @@ discard block |
||
35 | 35 | <?php lsx_content_wrap_after(); ?> |
36 | 36 | |
37 | 37 | <?php get_sidebar(); ?> |
38 | -<?php get_sidebar( 'alt' ); ?> |
|
38 | +<?php get_sidebar('alt'); ?> |
|
39 | 39 | |
40 | 40 | <?php get_footer(); |
41 | 41 | \ No newline at end of file |
@@ -12,20 +12,20 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -13,9 +13,9 @@ discard block |
||
13 | 13 | |
14 | 14 | <?php lsx_content_top(); ?> |
15 | 15 | |
16 | - <?php while ( have_posts() ) : the_post(); ?> |
|
16 | + <?php while (have_posts()) : the_post(); ?> |
|
17 | 17 | |
18 | - <?php get_template_part( 'content', 'page' ); ?> |
|
18 | + <?php get_template_part('content', 'page'); ?> |
|
19 | 19 | |
20 | 20 | <?php endwhile; // end of the loop. ?> |
21 | 21 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | <?php |
25 | 25 | // If comments are open or we have at least one comment, load up the comment template |
26 | - if ( comments_open() || '0' != get_comments_number() ) : |
|
26 | + if (comments_open() || '0' != get_comments_number()) : |
|
27 | 27 | comments_template(); |
28 | 28 | endif; |
29 | 29 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * lsx Comment Walker |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $GLOBALS['comment_depth'] = $depth; |
30 | 30 | $GLOBALS['comment'] = $comment; |
31 | 31 | |
32 | - if (!empty($args['callback'])) { |
|
32 | + if ( ! empty($args['callback'])) { |
|
33 | 33 | call_user_func($args['callback'], $comment, $args, $depth); |
34 | 34 | return; |
35 | 35 | }?> |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | function end_el(&$output, $comment, $depth = 0, $args = array()) { |
43 | - if (!empty($args['end-callback'])) { |
|
43 | + if ( ! empty($args['end-callback'])) { |
|
44 | 44 | call_user_func($args['end-callback'], $comment, $args, $depth); |
45 | 45 | return; |
46 | 46 | } |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | } |
57 | 57 | add_filter('get_avatar', 'lsx_get_avatar'); |
58 | 58 | |
59 | -add_action( 'admin_bar_menu', function() { remove_filter( 'get_avatar','lsx_get_avatar' ); }, 0 ); |
|
60 | -add_action( 'wp_after_admin_bar_render', function() { add_filter( 'get_avatar','lsx_get_avatar' ); } ); |
|
59 | +add_action('admin_bar_menu', function() { remove_filter('get_avatar', 'lsx_get_avatar'); }, 0); |
|
60 | +add_action('wp_after_admin_bar_render', function() { add_filter('get_avatar', 'lsx_get_avatar'); } ); |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * Comment Form Field Filter |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | * @subpackage layout |
67 | 67 | */ |
68 | 68 | function lsx_comment_form_fields_filter($fields) { |
69 | - foreach($fields as &$field){ |
|
70 | - if(stristr('class=', $field)){ |
|
69 | + foreach ($fields as &$field) { |
|
70 | + if (stristr('class=', $field)) { |
|
71 | 71 | $field = str_replace('class="', 'class="form-control ', $field); |
72 | - }else{ |
|
72 | + } else { |
|
73 | 73 | $field = str_replace('<input', '<input class="form-control" ', $field); |
74 | 74 | } |
75 | 75 | } |
76 | 76 | return $fields; |
77 | 77 | } |
78 | -add_filter( 'comment_form_default_fields', 'lsx_comment_form_fields_filter'); |
|
78 | +add_filter('comment_form_default_fields', 'lsx_comment_form_fields_filter'); |
@@ -4,7 +4,7 @@ discard block |
||
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.5'); |
10 | 10 | |
@@ -19,22 +19,22 @@ discard block |
||
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 | require get_template_directory() . '/inc/welcome.php'; |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | * @category customizer |
48 | 48 | * @return $lsx_controls array() |
49 | 49 | */ |
50 | -function lsx_customizer_core_controls( $lsx_controls ) { |
|
50 | +function lsx_customizer_core_controls($lsx_controls) { |
|
51 | 51 | $lsx_controls['sections']['lsx-core'] = array( |
52 | - 'title' => esc_html__( 'Core Settings', 'lsx' ), |
|
53 | - 'description' => esc_html__( 'Change the core settings.', 'lsx' ), |
|
52 | + 'title' => esc_html__('Core Settings', 'lsx'), |
|
53 | + 'description' => esc_html__('Change the core settings.', 'lsx'), |
|
54 | 54 | 'priority' => 21 |
55 | 55 | ); |
56 | 56 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | ); |
62 | 62 | |
63 | 63 | $lsx_controls['fields']['lsx_lazyload_status'] = array( |
64 | - 'label' => esc_html__( 'Lazy Loading Images', 'lsx' ), |
|
64 | + 'label' => esc_html__('Lazy Loading Images', 'lsx'), |
|
65 | 65 | 'section' => 'lsx-core', |
66 | 66 | 'type' => 'checkbox', |
67 | 67 | ); |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | ); |
74 | 74 | |
75 | 75 | $lsx_controls['fields']['lsx_preloader_content_status'] = array( |
76 | - 'label' => esc_html__( 'Preloader Content', 'lsx' ), |
|
76 | + 'label' => esc_html__('Preloader Content', 'lsx'), |
|
77 | 77 | 'section' => 'lsx-core', |
78 | 78 | 'type' => 'checkbox', |
79 | 79 | ); |
80 | 80 | |
81 | 81 | return $lsx_controls; |
82 | 82 | } |
83 | -add_filter( 'lsx_customizer_controls', 'lsx_customizer_core_controls' ); |
|
83 | +add_filter('lsx_customizer_controls', 'lsx_customizer_core_controls'); |
|
84 | 84 | |
85 | 85 | /** |
86 | 86 | * Returns an array of the layout panel. |
@@ -91,56 +91,56 @@ discard block |
||
91 | 91 | * @return $lsx_controls array() |
92 | 92 | */ |
93 | 93 | function lsx_customizer_layout_controls($lsx_controls) { |
94 | - $lsx_controls['settings']['lsx_header_layout'] = array( |
|
94 | + $lsx_controls['settings']['lsx_header_layout'] = array( |
|
95 | 95 | 'default' => 'inline', //Default setting/value to save |
96 | 96 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
97 | 97 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
98 | 98 | ); |
99 | 99 | $lsx_controls['fields']['lsx_header_layout'] = array( |
100 | - 'label' => esc_html__('Header','lsx'), |
|
100 | + 'label' => esc_html__('Header', 'lsx'), |
|
101 | 101 | 'section' => 'lsx-layout', |
102 | 102 | 'control' => 'LSX_Customize_Header_Layout_Control', |
103 | - 'choices' => array('central','expanded','inline') |
|
103 | + 'choices' => array('central', 'expanded', 'inline') |
|
104 | 104 | ); |
105 | 105 | $lsx_controls['sections']['lsx-layout'] = array( |
106 | - 'title' => esc_html__( 'Layout', 'lsx' ), |
|
107 | - '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' ), |
|
106 | + 'title' => esc_html__('Layout', 'lsx'), |
|
107 | + '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'), |
|
108 | 108 | 'priority' => 22 |
109 | 109 | ); |
110 | - $lsx_controls['settings']['lsx_layout'] = array( |
|
110 | + $lsx_controls['settings']['lsx_layout'] = array( |
|
111 | 111 | 'default' => '2cr', //Default setting/value to save |
112 | 112 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
113 | 113 | 'transport' => 'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
114 | 114 | ); |
115 | - $lsx_controls['settings']['lsx_header_fixed'] = array( |
|
115 | + $lsx_controls['settings']['lsx_header_fixed'] = array( |
|
116 | 116 | 'default' => false, //Default setting/value to save |
117 | 117 | 'sanitize_callback' => 'lsx_sanitize_checkbox', |
118 | 118 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
119 | 119 | ); |
120 | 120 | $lsx_controls['fields']['lsx_header_fixed'] = array( |
121 | - 'label' => esc_html__('Fixed Header','lsx'), |
|
121 | + 'label' => esc_html__('Fixed Header', 'lsx'), |
|
122 | 122 | 'section' => 'lsx-layout', |
123 | 123 | 'type' => 'checkbox', |
124 | 124 | ); |
125 | - $lsx_controls['settings']['lsx_header_search'] = array( |
|
125 | + $lsx_controls['settings']['lsx_header_search'] = array( |
|
126 | 126 | 'default' => false, //Default setting/value to save |
127 | 127 | 'sanitize_callback' => 'lsx_sanitize_checkbox', |
128 | 128 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
129 | 129 | ); |
130 | 130 | $lsx_controls['fields']['lsx_header_search'] = array( |
131 | - 'label' => esc_html__('Search Box in Header','lsx'), |
|
131 | + 'label' => esc_html__('Search Box in Header', 'lsx'), |
|
132 | 132 | 'section' => 'lsx-layout', |
133 | 133 | 'type' => 'checkbox', |
134 | 134 | ); |
135 | 135 | $lsx_controls['fields']['lsx_layout'] = array( |
136 | - 'label' => esc_html__('Body','lsx'), |
|
136 | + 'label' => esc_html__('Body', 'lsx'), |
|
137 | 137 | 'section' => 'lsx-layout', |
138 | 138 | 'control' => 'LSX_Customize_Layout_Control', |
139 | - 'choices' => array('1c','2cr','2cl') |
|
139 | + 'choices' => array('1c', '2cr', '2cl') |
|
140 | 140 | ); |
141 | 141 | return $lsx_controls; |
142 | 142 | } |
143 | -add_filter('lsx_customizer_controls','lsx_customizer_layout_controls'); |
|
143 | +add_filter('lsx_customizer_controls', 'lsx_customizer_layout_controls'); |
|
144 | 144 | |
145 | 145 | /** |
146 | 146 | * Returns an array of the font controls. |
@@ -152,11 +152,11 @@ discard block |
||
152 | 152 | */ |
153 | 153 | function lsx_customizer_font_controls($lsx_controls) { |
154 | 154 | $lsx_controls['sections']['lsx-font'] = array( |
155 | - 'title' => esc_html__( 'Font', 'lsx' ), |
|
155 | + 'title' => esc_html__('Font', 'lsx'), |
|
156 | 156 | 'description' => 'Change the fonts sitewide.', |
157 | 157 | 'priority' => 41 |
158 | 158 | ); |
159 | - $lsx_controls['settings']['lsx_font'] = array( |
|
159 | + $lsx_controls['settings']['lsx_font'] = array( |
|
160 | 160 | 'default' => 'raleway_open_sans', //Default setting/value to save |
161 | 161 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
162 | 162 | 'transport' => 'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
@@ -170,13 +170,13 @@ discard block |
||
170 | 170 | 'choices' => array( |
171 | 171 | 'raleway_open_sans' => array( |
172 | 172 | 'header' => array( |
173 | - "title" => esc_html__( 'Raleway', 'lsx' ), |
|
173 | + "title" => esc_html__('Raleway', 'lsx'), |
|
174 | 174 | "location" => "Raleway", |
175 | 175 | "cssDeclaration" => "'Raleway', sans-serif", |
176 | 176 | "cssClass" => "raleway", |
177 | 177 | ), |
178 | 178 | 'body' => array( |
179 | - "title" => esc_html__( 'Open Sans', 'lsx' ), |
|
179 | + "title" => esc_html__('Open Sans', 'lsx'), |
|
180 | 180 | "location" => "Open+Sans", |
181 | 181 | "cssDeclaration" => "'Open Sans', sans-serif", |
182 | 182 | "cssClass" => "openSans" |
@@ -184,13 +184,13 @@ discard block |
||
184 | 184 | ), |
185 | 185 | 'noto_serif_noto_sans' => array( |
186 | 186 | 'header' => array( |
187 | - "title" => esc_html__( 'Noto Serif', 'lsx' ), |
|
187 | + "title" => esc_html__('Noto Serif', 'lsx'), |
|
188 | 188 | "location" => "Noto+Serif", |
189 | 189 | "cssDeclaration" => "'Noto Serif', serif", |
190 | 190 | "cssClass" => "notoSerif", |
191 | 191 | ), |
192 | 192 | 'body' => array( |
193 | - "title" => esc_html__( 'Noto Sans', 'lsx' ), |
|
193 | + "title" => esc_html__('Noto Sans', 'lsx'), |
|
194 | 194 | "location" => "Noto+Sans", |
195 | 195 | "cssDeclaration" => "'Noto Sans', sans-serif", |
196 | 196 | "cssClass" => "notoSans", |
@@ -198,13 +198,13 @@ discard block |
||
198 | 198 | ), |
199 | 199 | 'noto_sans_noto_sans' => array( |
200 | 200 | 'header' => array( |
201 | - "title" => esc_html__( 'Noto Sans', 'lsx' ), |
|
201 | + "title" => esc_html__('Noto Sans', 'lsx'), |
|
202 | 202 | "location" => "Noto+Sans", |
203 | 203 | "cssDeclaration" => "'Noto Sans', sans-serif", |
204 | 204 | "cssClass" => "notoSans", |
205 | 205 | ), |
206 | 206 | 'body' => array( |
207 | - "title" => esc_html__( 'Noto Sans', 'lsx' ), |
|
207 | + "title" => esc_html__('Noto Sans', 'lsx'), |
|
208 | 208 | "location" => "Noto+Sans", |
209 | 209 | "cssDeclaration" => "'Noto Sans', sans-serif", |
210 | 210 | "cssClass" => "notoSans", |
@@ -212,13 +212,13 @@ discard block |
||
212 | 212 | ), |
213 | 213 | 'alegreya_open_sans' => array( |
214 | 214 | 'header' => array( |
215 | - "title" => esc_html__( 'Alegreya', 'lsx' ), |
|
215 | + "title" => esc_html__('Alegreya', 'lsx'), |
|
216 | 216 | "location" => "Alegreya", |
217 | 217 | "cssDeclaration" => "'Alegreya', serif", |
218 | 218 | "cssClass" => "alegreya", |
219 | 219 | ), |
220 | 220 | 'body' => array( |
221 | - "title" => esc_html__( 'Open Sans', 'lsx' ), |
|
221 | + "title" => esc_html__('Open Sans', 'lsx'), |
|
222 | 222 | "location" => "Open+Sans", |
223 | 223 | "cssDeclaration" => "'Open Sans', sans-serif", |
224 | 224 | "cssClass" => "openSans" |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | ); |
230 | 230 | return $lsx_controls; |
231 | 231 | } |
232 | -add_filter('lsx_customizer_controls','lsx_customizer_font_controls'); |
|
232 | +add_filter('lsx_customizer_controls', 'lsx_customizer_font_controls'); |
|
233 | 233 | |
234 | 234 | /** |
235 | 235 | * Returns an array of $controls for the customizer class to generate. |
@@ -239,12 +239,12 @@ discard block |
||
239 | 239 | * @category customizer |
240 | 240 | * @return $lsx_controls array() |
241 | 241 | */ |
242 | -function lsx_get_customizer_controls(){ |
|
242 | +function lsx_get_customizer_controls() { |
|
243 | 243 | $lsx_controls = array(); |
244 | 244 | $lsx_controls = apply_filters('lsx_customizer_controls', $lsx_controls); |
245 | 245 | return $lsx_controls; |
246 | 246 | } |
247 | -$lsx_customizer = new LSX_Theme_Customizer( lsx_get_customizer_controls() ); |
|
247 | +$lsx_customizer = new LSX_Theme_Customizer(lsx_get_customizer_controls()); |
|
248 | 248 | |
249 | -add_image_size( 'lsx-thumbnail-wide', 350, 230, true ); |
|
250 | -add_image_size( 'lsx-thumbnail-single', 750, 350, true ); |
|
251 | 249 | \ No newline at end of file |
250 | +add_image_size('lsx-thumbnail-wide', 350, 230, true); |
|
251 | +add_image_size('lsx-thumbnail-single', 750, 350, true); |
|
252 | 252 | \ No newline at end of file |
@@ -7,42 +7,42 @@ discard block |
||
7 | 7 | <?php lsx_entry_before(); ?> |
8 | 8 | |
9 | 9 | <?php |
10 | - if ( has_post_thumbnail() ) { |
|
10 | + if (has_post_thumbnail()) { |
|
11 | 11 | $thumb_class = 'has-thumb'; |
12 | 12 | } else { |
13 | 13 | $thumb_class = 'no-thumb'; |
14 | 14 | } |
15 | 15 | |
16 | - if ( ! is_singular() ) { |
|
17 | - $blog_layout = apply_filters( 'lsx_blog_layout', 'default' ); |
|
16 | + if ( ! is_singular()) { |
|
17 | + $blog_layout = apply_filters('lsx_blog_layout', 'default'); |
|
18 | 18 | } else { |
19 | 19 | $blog_layout = 'default'; |
20 | 20 | } |
21 | 21 | |
22 | - if ( 'list' === $blog_layout ) { |
|
22 | + if ('list' === $blog_layout) { |
|
23 | 23 | $image_class = 'hidden-sm hidden-md hidden-ls'; |
24 | 24 | } else { |
25 | 25 | $image_class = ''; |
26 | 26 | } |
27 | 27 | |
28 | - $thumbnail_id = get_post_thumbnail_id( get_the_ID() ); |
|
29 | - $image_arr = wp_get_attachment_image_src( $thumbnail_id, 'lsx-single-thumbnail' ); |
|
28 | + $thumbnail_id = get_post_thumbnail_id(get_the_ID()); |
|
29 | + $image_arr = wp_get_attachment_image_src($thumbnail_id, 'lsx-single-thumbnail'); |
|
30 | 30 | |
31 | - if ( is_array( $image_arr ) ) { |
|
31 | + if (is_array($image_arr)) { |
|
32 | 32 | $image_src = $image_arr[0]; |
33 | 33 | } |
34 | 34 | ?> |
35 | 35 | |
36 | -<article id="post-<?php the_ID(); ?>" <?php post_class( $thumb_class ); ?>> |
|
36 | +<article id="post-<?php the_ID(); ?>" <?php post_class($thumb_class); ?>> |
|
37 | 37 | <?php lsx_entry_top(); ?> |
38 | 38 | |
39 | 39 | <div class="entry-layout"> |
40 | 40 | <div class="entry-layout-content entry-layout-content-<?php echo has_post_thumbnail() ? '67' : '100'; ?>"> |
41 | 41 | <header class="entry-header"> |
42 | - <?php if ( has_post_thumbnail() ) : ?> |
|
43 | - <div class="entry-image <?php echo esc_attr( $image_class ); ?>"> |
|
42 | + <?php if (has_post_thumbnail()) : ?> |
|
43 | + <div class="entry-image <?php echo esc_attr($image_class); ?>"> |
|
44 | 44 | <a class="thumbnail" href="<?php the_permalink(); ?>"> |
45 | - <?php lsx_thumbnail( 'lsx-single-thumbnail' ); ?> |
|
45 | + <?php lsx_thumbnail('lsx-single-thumbnail'); ?> |
|
46 | 46 | </a> |
47 | 47 | </div> |
48 | 48 | <?php endif; ?> |
@@ -50,37 +50,37 @@ discard block |
||
50 | 50 | <?php |
51 | 51 | $format = get_post_format(); |
52 | 52 | |
53 | - if ( false === $format ) { |
|
53 | + if (false === $format) { |
|
54 | 54 | $format = 'standard'; |
55 | - $show_on_front = get_option( 'show_on_front', 'posts' ); |
|
55 | + $show_on_front = get_option('show_on_front', 'posts'); |
|
56 | 56 | |
57 | - if ( 'page' == $show_on_front ) { |
|
58 | - $archive_link = get_permalink( get_option( 'page_for_posts' ) ); |
|
57 | + if ('page' == $show_on_front) { |
|
58 | + $archive_link = get_permalink(get_option('page_for_posts')); |
|
59 | 59 | } else { |
60 | 60 | $archive_link = home_url(); |
61 | 61 | } |
62 | 62 | } else { |
63 | - $archive_link = get_post_format_link( $format ); |
|
63 | + $archive_link = get_post_format_link($format); |
|
64 | 64 | } |
65 | 65 | |
66 | - $format = lsx_translate_format_to_fontawesome( $format ); |
|
66 | + $format = lsx_translate_format_to_fontawesome($format); |
|
67 | 67 | ?> |
68 | 68 | |
69 | 69 | <h1 class="entry-title"> |
70 | - <?php if ( has_post_thumbnail() ) : ?> |
|
71 | - <a href="<?php echo esc_url( $archive_link ) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
70 | + <?php if (has_post_thumbnail()) : ?> |
|
71 | + <a href="<?php echo esc_url($archive_link) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr($format) ?>"></a> |
|
72 | 72 | <?php else : ?> |
73 | - <a href="<?php echo esc_url( $archive_link ) ?>" class="format-link fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
73 | + <a href="<?php echo esc_url($archive_link) ?>" class="format-link fa fa-<?php echo esc_attr($format) ?>"></a> |
|
74 | 74 | <?php endif; ?> |
75 | 75 | |
76 | - <?php if ( has_post_format( array('link') ) ) : ?> |
|
77 | - <a href="<?php echo esc_url( lsx_get_my_url() ); ?>" rel="bookmark"><?php the_title(); ?> <span class="fa fa-external-link"></span></a> |
|
76 | + <?php if (has_post_format(array('link'))) : ?> |
|
77 | + <a href="<?php echo esc_url(lsx_get_my_url()); ?>" rel="bookmark"><?php the_title(); ?> <span class="fa fa-external-link"></span></a> |
|
78 | 78 | <?php else : ?> |
79 | 79 | <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> |
80 | 80 | <?php endif; ?> |
81 | 81 | |
82 | - <?php if ( is_sticky() ) : ?> |
|
83 | - <span class="label label-default label-sticky"><?php esc_html_e( 'Featured', 'lsx' ); ?></span> |
|
82 | + <?php if (is_sticky()) : ?> |
|
83 | + <span class="label label-default label-sticky"><?php esc_html_e('Featured', 'lsx'); ?></span> |
|
84 | 84 | <?php endif; ?> |
85 | 85 | </h1> |
86 | 86 | |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | </div><!-- .entry-meta --> |
90 | 90 | </header><!-- .entry-header --> |
91 | 91 | |
92 | - <?php if ( ! is_singular() && ! has_post_format( array( 'video', 'audio', 'quote', 'link' ) ) && ! apply_filters( 'lsx_blog_force_content_on_list', false ) ) : // Only display Excerpts for Search and Archives ?> |
|
92 | + <?php if ( ! is_singular() && ! has_post_format(array('video', 'audio', 'quote', 'link')) && ! apply_filters('lsx_blog_force_content_on_list', false)) : // Only display Excerpts for Search and Archives ?> |
|
93 | 93 | <div class="entry-summary"> |
94 | 94 | <?php the_excerpt(); ?> |
95 | 95 | </div><!-- .entry-summary --> |
96 | - <?php elseif ( has_post_format( array('link') ) ) : ?> |
|
96 | + <?php elseif (has_post_format(array('link'))) : ?> |
|
97 | 97 | |
98 | - <?php elseif ( apply_filters( 'lsx_blog_force_content_on_list', false ) ) : ?> |
|
98 | + <?php elseif (apply_filters('lsx_blog_force_content_on_list', false)) : ?> |
|
99 | 99 | <div class="entry-content"> |
100 | 100 | <?php the_content(); ?> |
101 | 101 | </div><!-- .entry-content --> |
@@ -104,12 +104,12 @@ discard block |
||
104 | 104 | <?php |
105 | 105 | the_content(); |
106 | 106 | |
107 | - wp_link_pages( array( |
|
107 | + wp_link_pages(array( |
|
108 | 108 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
109 | 109 | 'after' => '</div></div>', |
110 | 110 | 'link_before' => '<span>', |
111 | 111 | 'link_after' => '</span>' |
112 | - ) ); |
|
112 | + )); |
|
113 | 113 | ?> |
114 | 114 | </div><!-- .entry-content --> |
115 | 115 | <?php endif; ?> |
@@ -119,19 +119,19 @@ discard block |
||
119 | 119 | <?php |
120 | 120 | $comments_number = get_comments_number(); |
121 | 121 | |
122 | - if ( has_tag() || ( comments_open() && ! empty( $comments_number ) ) ) : |
|
122 | + if (has_tag() || (comments_open() && ! empty($comments_number))) : |
|
123 | 123 | ?> |
124 | 124 | |
125 | 125 | <div class="post-tags-wrapper"> |
126 | 126 | <?php lsx_content_post_tags(); ?> |
127 | 127 | |
128 | - <?php if ( comments_open() && ! empty( $comments_number ) ) : ?> |
|
128 | + <?php if (comments_open() && ! empty($comments_number)) : ?> |
|
129 | 129 | <div class="post-comments"> |
130 | 130 | <a href="<?php the_permalink() ?>#comments"> |
131 | 131 | <?php |
132 | 132 | printf( |
133 | - esc_html( _n( 'One Comment', '%1$s Comments', $comments_number, 'lsx' ) ), |
|
134 | - esc_html( number_format_i18n( $comments_number ) ) |
|
133 | + esc_html(_n('One Comment', '%1$s Comments', $comments_number, 'lsx')), |
|
134 | + esc_html(number_format_i18n($comments_number)) |
|
135 | 135 | ); |
136 | 136 | ?> |
137 | 137 | </a> |
@@ -144,10 +144,10 @@ discard block |
||
144 | 144 | ?> |
145 | 145 | </div> |
146 | 146 | |
147 | - <?php if ( has_post_thumbnail() ) : ?> |
|
147 | + <?php if (has_post_thumbnail()) : ?> |
|
148 | 148 | <div class="entry-image hidden hidden-xs"> |
149 | - <a class="thumbnail" href="<?php the_permalink(); ?>" style="background-image:url(<?php echo esc_url( $image_src ); ?>);"> |
|
150 | - <?php lsx_thumbnail( 'lsx-single-thumbnail' ); ?> |
|
149 | + <a class="thumbnail" href="<?php the_permalink(); ?>" style="background-image:url(<?php echo esc_url($image_src); ?>);"> |
|
150 | + <?php lsx_thumbnail('lsx-single-thumbnail'); ?> |
|
151 | 151 | </a> |
152 | 152 | </div> |
153 | 153 | <?php endif; ?> |
@@ -157,9 +157,9 @@ discard block |
||
157 | 157 | |
158 | 158 | <div class="clearfix"></div> |
159 | 159 | |
160 | - <?php edit_post_link( esc_html__( 'Edit', 'lsx' ), '<span class="edit-link">', '</span>' ); ?> |
|
160 | + <?php edit_post_link(esc_html__('Edit', 'lsx'), '<span class="edit-link">', '</span>'); ?> |
|
161 | 161 | |
162 | - <?php if ( ! is_singular() && ! is_single() ) : // Display full-width divider on Archives ?> |
|
162 | + <?php if ( ! is_singular() && ! is_single()) : // Display full-width divider on Archives ?> |
|
163 | 163 | <div class="lsx-breaker"></div> |
164 | 164 | <?php endif; ?> |
165 | 165 | </article> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Yoast Breadcrumbs on Twitter Bootstrap |
@@ -10,21 +10,21 @@ discard block |
||
10 | 10 | * @param string $sep Your custom separator |
11 | 11 | */ |
12 | 12 | function lsx_breadcrumbs() { |
13 | - if (!function_exists('yoast_breadcrumb') && !function_exists('woocommerce_breadcrumb')) { |
|
13 | + if ( ! function_exists('yoast_breadcrumb') && ! function_exists('woocommerce_breadcrumb')) { |
|
14 | 14 | return null; |
15 | 15 | } |
16 | 16 | |
17 | 17 | $show_on_front = get_option('show_on_front'); |
18 | - if ( ('posts' == $show_on_front && is_home()) || ('page' == $show_on_front && is_front_page()) ) { |
|
18 | + if (('posts' == $show_on_front && is_home()) || ('page' == $show_on_front && is_front_page())) { |
|
19 | 19 | return; |
20 | 20 | } |
21 | 21 | |
22 | - if(function_exists('woocommerce_breadcrumb')){ |
|
22 | + if (function_exists('woocommerce_breadcrumb')) { |
|
23 | 23 | ob_start(); |
24 | 24 | woocommerce_breadcrumb(); |
25 | 25 | $output = ob_get_clean(); |
26 | 26 | $output = str_replace('woocommerce-breadcrumb', 'woocommerce-breadcrumb breadcrumbs-container', $output); |
27 | - }elseif(function_exists('yoast_breadcrumb')){ |
|
27 | + }elseif (function_exists('yoast_breadcrumb')) { |
|
28 | 28 | // Default Yoast Breadcrumbs Separator |
29 | 29 | $old_sep = '\»\;'; |
30 | 30 | |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | $output = '<div class="breadcrumbs-container">' . $output . '</div>'; |
43 | 43 | } |
44 | 44 | |
45 | - $output = apply_filters('lsx_breadcrumbs',$output); |
|
45 | + $output = apply_filters('lsx_breadcrumbs', $output); |
|
46 | 46 | |
47 | - echo wp_kses_post( $output ); |
|
47 | + echo wp_kses_post($output); |
|
48 | 48 | } |
49 | -add_action( 'lsx_content_top', 'lsx_breadcrumbs', 100 ); |
|
49 | +add_action('lsx_content_top', 'lsx_breadcrumbs', 100); |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * Replaces the seperator with a blank space. |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | function lsx_breadcrumbs_seperator_filter($seperator) { |
56 | 56 | return ''; |
57 | 57 | } |
58 | -add_filter( 'wpseo_breadcrumb_separator', 'lsx_breadcrumbs_seperator_filter' ); |
|
58 | +add_filter('wpseo_breadcrumb_separator', 'lsx_breadcrumbs_seperator_filter'); |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Custom template tags for this theme. |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @package lsx |
65 | 65 | */ |
66 | -if ( ! function_exists( 'lsx_site_title' ) ) : |
|
66 | +if ( ! function_exists('lsx_site_title')) : |
|
67 | 67 | /** |
68 | 68 | * Displays logo when applicable |
69 | 69 | * |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | function lsx_site_title() { |
73 | 73 | ?> |
74 | 74 | <div class="site-branding"> |
75 | - <h1 class="site-title"><a title="<?php bloginfo( 'name' ); ?>" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> |
|
76 | - <p class="site-description"><?php bloginfo( 'description' ); ?></p> |
|
75 | + <h1 class="site-title"><a title="<?php bloginfo('name'); ?>" href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></h1> |
|
76 | + <p class="site-description"><?php bloginfo('description'); ?></p> |
|
77 | 77 | </div> |
78 | 78 | <?php |
79 | 79 | } |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | /** |
83 | 83 | * Add customisable post meta. |
84 | 84 | */ |
85 | -if ( ! function_exists( 'lsx_post_meta' ) ) { |
|
85 | +if ( ! function_exists('lsx_post_meta')) { |
|
86 | 86 | function lsx_post_meta() { |
87 | - if ( ( is_page() && ! ( is_home() || is_front_page() ) ) && ! is_page_template( 'page-templates/template-blog.php' ) ) { |
|
87 | + if ((is_page() && ! (is_home() || is_front_page())) && ! is_page_template('page-templates/template-blog.php')) { |
|
88 | 88 | return; |
89 | 89 | } |
90 | 90 | ?> |
@@ -99,94 +99,94 @@ discard block |
||
99 | 99 | /** |
100 | 100 | * Add customisable post meta: post date |
101 | 101 | */ |
102 | -if ( ! function_exists( 'lsx_post_meta_date' ) ) { |
|
102 | +if ( ! function_exists('lsx_post_meta_date')) { |
|
103 | 103 | function lsx_post_meta_date() { |
104 | 104 | $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; |
105 | 105 | |
106 | - $time_string = sprintf( $time_string, |
|
107 | - esc_attr( get_the_date( 'c' ) ), |
|
106 | + $time_string = sprintf($time_string, |
|
107 | + esc_attr(get_the_date('c')), |
|
108 | 108 | get_the_date(), |
109 | - esc_attr( get_the_modified_date( 'c' ) ), |
|
109 | + esc_attr(get_the_modified_date('c')), |
|
110 | 110 | get_the_modified_date() |
111 | 111 | ); |
112 | 112 | |
113 | - printf( '<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>', |
|
114 | - esc_html_x( 'Posted on:', 'Used before publish date.', 'lsx' ), |
|
115 | - esc_url( get_permalink() ), |
|
116 | - wp_kses_post( $time_string ) |
|
113 | + printf('<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>', |
|
114 | + esc_html_x('Posted on:', 'Used before publish date.', 'lsx'), |
|
115 | + esc_url(get_permalink()), |
|
116 | + wp_kses_post($time_string) |
|
117 | 117 | ); |
118 | 118 | } |
119 | 119 | } |
120 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_date', 10 ); |
|
120 | +add_action('lsx_content_post_meta', 'lsx_post_meta_date', 10); |
|
121 | 121 | |
122 | 122 | /** |
123 | 123 | * Add customisable post meta: post author |
124 | 124 | */ |
125 | -if ( ! function_exists( 'lsx_post_meta_author' ) ) { |
|
125 | +if ( ! function_exists('lsx_post_meta_author')) { |
|
126 | 126 | function lsx_post_meta_author() { |
127 | 127 | $author = get_the_author(); |
128 | - $author_url = esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); |
|
128 | + $author_url = esc_url(get_author_posts_url(get_the_author_meta('ID'))); |
|
129 | 129 | |
130 | - if ( empty( $author ) ) { |
|
130 | + if (empty($author)) { |
|
131 | 131 | global $post; |
132 | 132 | |
133 | - $author = get_user_by( 'ID', $post->post_author ); |
|
133 | + $author = get_user_by('ID', $post->post_author); |
|
134 | 134 | $author = $author->display_name; |
135 | - $author_url = esc_url( get_author_posts_url( $post->post_author ) ); |
|
135 | + $author_url = esc_url(get_author_posts_url($post->post_author)); |
|
136 | 136 | } |
137 | 137 | |
138 | - printf( '<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>', |
|
139 | - esc_html_x( 'Posted by:', 'Used before post author name.', 'lsx' ), |
|
138 | + printf('<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>', |
|
139 | + esc_html_x('Posted by:', 'Used before post author name.', 'lsx'), |
|
140 | 140 | $author_url, |
141 | 141 | $author |
142 | 142 | ); |
143 | 143 | } |
144 | 144 | } |
145 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_author', 20 ); |
|
145 | +add_action('lsx_content_post_meta', 'lsx_post_meta_author', 20); |
|
146 | 146 | |
147 | 147 | /** |
148 | 148 | * Add customisable post meta: post category(ies) |
149 | 149 | */ |
150 | -if ( ! function_exists( 'lsx_post_meta_category' ) ) { |
|
150 | +if ( ! function_exists('lsx_post_meta_category')) { |
|
151 | 151 | function lsx_post_meta_category() { |
152 | - $post_categories = wp_get_post_categories( get_the_ID() ); |
|
152 | + $post_categories = wp_get_post_categories(get_the_ID()); |
|
153 | 153 | $cats = array(); |
154 | 154 | |
155 | - foreach( $post_categories as $c ) { |
|
156 | - $cat = get_category( $c ); |
|
157 | - $cats[] = '<a href="' . get_category_link( $cat->term_id ) . '" title="' . sprintf( esc_html__( 'View all posts in %s' , 'lsx' ), $cat->name ) . '" ' . '>' . $cat->name . '</a>'; |
|
155 | + foreach ($post_categories as $c) { |
|
156 | + $cat = get_category($c); |
|
157 | + $cats[] = '<a href="' . get_category_link($cat->term_id) . '" title="' . sprintf(esc_html__('View all posts in %s', 'lsx'), $cat->name) . '" ' . '>' . $cat->name . '</a>'; |
|
158 | 158 | } |
159 | 159 | |
160 | - if ( ! empty( $cats ) ) { |
|
160 | + if ( ! empty($cats)) { |
|
161 | 161 | ?> |
162 | - <span class="post-meta-categories"><span><?php esc_html_e( 'Posted in:', 'lsx' ); ?></span> <?php echo wp_kses_post( implode( ', ', $cats ) ); ?></span> |
|
162 | + <span class="post-meta-categories"><span><?php esc_html_e('Posted in:', 'lsx'); ?></span> <?php echo wp_kses_post(implode(', ', $cats)); ?></span> |
|
163 | 163 | <?php |
164 | 164 | } |
165 | 165 | } |
166 | 166 | } |
167 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_category', 30 ); |
|
167 | +add_action('lsx_content_post_meta', 'lsx_post_meta_category', 30); |
|
168 | 168 | |
169 | 169 | /** |
170 | 170 | * Add customisable post meta: post tag(s) |
171 | 171 | */ |
172 | -if ( ! function_exists( 'lsx_post_tags' ) ) { |
|
172 | +if ( ! function_exists('lsx_post_tags')) { |
|
173 | 173 | function lsx_post_tags() { |
174 | - if ( has_tag() ) : |
|
174 | + if (has_tag()) : |
|
175 | 175 | ?> |
176 | 176 | <div class="post-tags"> |
177 | - <span><?php esc_html_e( 'Tagged as:', 'lsx' ); ?></span> <?php echo wp_kses_post( get_the_tag_list( '' ) ); ?> |
|
177 | + <span><?php esc_html_e('Tagged as:', 'lsx'); ?></span> <?php echo wp_kses_post(get_the_tag_list('')); ?> |
|
178 | 178 | </div> |
179 | 179 | <?php |
180 | 180 | endif; |
181 | 181 | } |
182 | 182 | } |
183 | -add_action( 'lsx_content_post_tags', 'lsx_post_tags', 10 ); |
|
183 | +add_action('lsx_content_post_tags', 'lsx_post_tags', 10); |
|
184 | 184 | |
185 | 185 | /** |
186 | 186 | * Add customisable post info: related posts |
187 | 187 | */ |
188 | 188 | function lsx_related_posts() { |
189 | - if ( is_singular( 'post' ) && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
189 | + if (is_singular('post') && class_exists('Jetpack_RelatedPosts')) { |
|
190 | 190 | ?> |
191 | 191 | <div class="row row-related-posts"> |
192 | 192 | <div class="col-md-12"> |
@@ -196,15 +196,15 @@ discard block |
||
196 | 196 | <?php |
197 | 197 | } |
198 | 198 | } |
199 | -add_action( 'lsx_entry_bottom', 'lsx_related_posts', 10 ); |
|
199 | +add_action('lsx_entry_bottom', 'lsx_related_posts', 10); |
|
200 | 200 | |
201 | 201 | /** |
202 | 202 | * Translate post format to Font Awesome class |
203 | 203 | */ |
204 | 204 | |
205 | -if ( ! function_exists( 'lsx_translate_format_to_fontawesome' ) ) { |
|
206 | - function lsx_translate_format_to_fontawesome( $format ) { |
|
207 | - switch ( $format ) { |
|
205 | +if ( ! function_exists('lsx_translate_format_to_fontawesome')) { |
|
206 | + function lsx_translate_format_to_fontawesome($format) { |
|
207 | + switch ($format) { |
|
208 | 208 | case 'image': |
209 | 209 | $format = 'camera'; |
210 | 210 | break; |
@@ -249,45 +249,45 @@ discard block |
||
249 | 249 | * to be added/modified where necessary. |
250 | 250 | */ |
251 | 251 | |
252 | -if ( ! function_exists( 'lsx_portfolio_meta' ) ) { |
|
252 | +if ( ! function_exists('lsx_portfolio_meta')) { |
|
253 | 253 | function lsx_portfolio_meta() { |
254 | 254 | ?> |
255 | 255 | <div id="portfolio-meta" class="portfolio-meta info-box-sticky info-box sticky-wrapper"> |
256 | 256 | <?php |
257 | - $client = get_post_meta(get_the_ID(),'lsx-client',true); |
|
258 | - if(false != $client){ ?> |
|
257 | + $client = get_post_meta(get_the_ID(), 'lsx-client', true); |
|
258 | + if (false != $client) { ?> |
|
259 | 259 | <div class="portfolio-client"> |
260 | - <span><span class="fa fa-user"></span><?php esc_html_e( 'Client','lsx' ); ?></span> |
|
261 | - <span><?php echo esc_html( $client ); ?></span> |
|
260 | + <span><span class="fa fa-user"></span><?php esc_html_e('Client', 'lsx'); ?></span> |
|
261 | + <span><?php echo esc_html($client); ?></span> |
|
262 | 262 | </div> |
263 | 263 | <?php } ?> |
264 | 264 | |
265 | 265 | <?php |
266 | - $portfolio_type = get_the_term_list( get_the_ID(), 'jetpack-portfolio-type', '', ', ', '' ); |
|
266 | + $portfolio_type = get_the_term_list(get_the_ID(), 'jetpack-portfolio-type', '', ', ', ''); |
|
267 | 267 | |
268 | - if($portfolio_type){ |
|
268 | + if ($portfolio_type) { |
|
269 | 269 | ?> |
270 | 270 | <div class="portfolio-industry"> |
271 | - <span><span class="fa fa-folder-open"></span><?php esc_html_e( 'Industry', 'lsx' ); ?></span> |
|
272 | - <?php echo wp_kses_post( $portfolio_type ); ?> |
|
271 | + <span><span class="fa fa-folder-open"></span><?php esc_html_e('Industry', 'lsx'); ?></span> |
|
272 | + <?php echo wp_kses_post($portfolio_type); ?> |
|
273 | 273 | </div> |
274 | 274 | <?php } ?> |
275 | 275 | |
276 | 276 | <?php |
277 | - $services = get_the_term_list( get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '' ); |
|
278 | - if(false != $services){ ?> |
|
277 | + $services = get_the_term_list(get_the_ID(), 'jetpack-portfolio-tag', '', ', ', ''); |
|
278 | + if (false != $services) { ?> |
|
279 | 279 | <div class="portfolio-services"> |
280 | - <span><span class="fa fa-cog"></span><?php esc_html_e( 'Services', 'lsx' ); ?></span> |
|
281 | - <?php echo wp_kses_post( $services ); ?> |
|
280 | + <span><span class="fa fa-cog"></span><?php esc_html_e('Services', 'lsx'); ?></span> |
|
281 | + <?php echo wp_kses_post($services); ?> |
|
282 | 282 | </div> |
283 | 283 | <?php } ?> |
284 | 284 | |
285 | 285 | <?php |
286 | - $website = esc_url( get_post_meta(get_the_ID(),'lsx-website',true) ); |
|
287 | - if(false != $website){ ?> |
|
286 | + $website = esc_url(get_post_meta(get_the_ID(), 'lsx-website', true)); |
|
287 | + if (false != $website) { ?> |
|
288 | 288 | <div class="portfolio-website"> |
289 | - <span><span class="fa fa-link"></span><?php esc_html_e( 'Website', 'lsx' ); ?></span> |
|
290 | - <a target="_blank" href="<?php echo esc_url( $website ); ?>"><?php echo esc_html( $website ) ?></a> |
|
289 | + <span><span class="fa fa-link"></span><?php esc_html_e('Website', 'lsx'); ?></span> |
|
290 | + <a target="_blank" href="<?php echo esc_url($website); ?>"><?php echo esc_html($website) ?></a> |
|
291 | 291 | </div> |
292 | 292 | <?php } ?> |
293 | 293 | |
@@ -301,29 +301,29 @@ discard block |
||
301 | 301 | * |
302 | 302 | */ |
303 | 303 | |
304 | -if ( ! function_exists( 'lsx_portfolio_gallery' ) ) { |
|
304 | +if ( ! function_exists('lsx_portfolio_gallery')) { |
|
305 | 305 | function lsx_portfolio_gallery() { |
306 | 306 | |
307 | - $media = get_attached_media( 'image' ); |
|
307 | + $media = get_attached_media('image'); |
|
308 | 308 | $media_array = array(); |
309 | 309 | $post_thumbnail_id = get_post_thumbnail_id(get_the_ID()); |
310 | 310 | |
311 | - if(!empty($media)){ |
|
312 | - foreach($media as $media_item){ |
|
313 | - if($post_thumbnail_id != $media_item->ID) { |
|
311 | + if ( ! empty($media)) { |
|
312 | + foreach ($media as $media_item) { |
|
313 | + if ($post_thumbnail_id != $media_item->ID) { |
|
314 | 314 | $media_array[] = $media_item->ID; |
315 | 315 | } |
316 | 316 | } |
317 | 317 | |
318 | - if(!empty($media_array)){ |
|
319 | - echo wp_kses_post( gallery_shortcode( array( 'size' => 'full', 'ids' => implode( ',', $media_array ) ) ) ); |
|
318 | + if ( ! empty($media_array)) { |
|
319 | + echo wp_kses_post(gallery_shortcode(array('size' => 'full', 'ids' => implode(',', $media_array)))); |
|
320 | 320 | } |
321 | 321 | } |
322 | 322 | |
323 | 323 | } |
324 | 324 | } |
325 | 325 | |
326 | -if ( ! function_exists( 'lsx_paging_nav' ) ) : |
|
326 | +if ( ! function_exists('lsx_paging_nav')) : |
|
327 | 327 | /** |
328 | 328 | * Display navigation to next/previous set of posts when applicable. |
329 | 329 | * |
@@ -331,33 +331,33 @@ discard block |
||
331 | 331 | */ |
332 | 332 | function lsx_paging_nav() { |
333 | 333 | // Don't print empty markup if there's only one page. |
334 | - if ( $GLOBALS['wp_query']->max_num_pages < 2 ) { |
|
334 | + if ($GLOBALS['wp_query']->max_num_pages < 2) { |
|
335 | 335 | return; |
336 | 336 | } |
337 | 337 | |
338 | - if(current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')){ |
|
338 | + if (current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')) { |
|
339 | 339 | return true; |
340 | - }elseif(function_exists('wp_pagenavi')){ |
|
340 | + }elseif (function_exists('wp_pagenavi')) { |
|
341 | 341 | wp_pagenavi(); |
342 | - }else{ |
|
342 | + } else { |
|
343 | 343 | |
344 | 344 | $labels = array( |
345 | - 'next' => '<span class="meta-nav">←</span> '.esc_html__( 'Older posts', 'lsx' ), |
|
346 | - 'previous' => esc_html__( 'Newer posts', 'lsx' ).' <span class="meta-nav">→</span>', |
|
347 | - 'title' => esc_html__( 'Posts navigation', 'lsx' ) |
|
345 | + 'next' => '<span class="meta-nav">←</span> ' . esc_html__('Older posts', 'lsx'), |
|
346 | + 'previous' => esc_html__('Newer posts', 'lsx') . ' <span class="meta-nav">→</span>', |
|
347 | + 'title' => esc_html__('Posts navigation', 'lsx') |
|
348 | 348 | ); |
349 | - $labels = apply_filters('lsx_post_navigation_labels',$labels); |
|
349 | + $labels = apply_filters('lsx_post_navigation_labels', $labels); |
|
350 | 350 | ?> |
351 | 351 | <nav class="navigation paging-navigation" role="navigation"> |
352 | 352 | <div class="lsx-breaker"></div> |
353 | - <h1 class="screen-reader-text"><?php echo esc_html( $labels['title'] ); ?></h1> |
|
353 | + <h1 class="screen-reader-text"><?php echo esc_html($labels['title']); ?></h1> |
|
354 | 354 | <div class="nav-links"> |
355 | - <?php if ( get_next_posts_link() ) : ?> |
|
356 | - <div class="nav-previous"><?php next_posts_link( $labels['next'] ); ?></div> |
|
355 | + <?php if (get_next_posts_link()) : ?> |
|
356 | + <div class="nav-previous"><?php next_posts_link($labels['next']); ?></div> |
|
357 | 357 | <?php endif; ?> |
358 | 358 | |
359 | - <?php if ( get_previous_posts_link() ) : ?> |
|
360 | - <div class="nav-next"><?php previous_posts_link( $labels['previous'] ); ?></div> |
|
359 | + <?php if (get_previous_posts_link()) : ?> |
|
360 | + <div class="nav-next"><?php previous_posts_link($labels['previous']); ?></div> |
|
361 | 361 | <?php endif; ?> |
362 | 362 | |
363 | 363 | <div class="clearfix"></div> |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | } |
369 | 369 | endif; |
370 | 370 | |
371 | -if ( ! function_exists( 'lsx_post_nav' ) ) : |
|
371 | +if ( ! function_exists('lsx_post_nav')) : |
|
372 | 372 | /** |
373 | 373 | * Display navigation to next/previous post when applicable. |
374 | 374 | * |
@@ -376,10 +376,10 @@ discard block |
||
376 | 376 | */ |
377 | 377 | function lsx_post_nav() { |
378 | 378 | // Don't print empty markup if there's nowhere to navigate. |
379 | - $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); |
|
380 | - $next = get_adjacent_post( false, '', false ); |
|
379 | + $previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true); |
|
380 | + $next = get_adjacent_post(false, '', false); |
|
381 | 381 | |
382 | - if ( ! $next && ! $previous ) { |
|
382 | + if ( ! $next && ! $previous) { |
|
383 | 383 | return; |
384 | 384 | } |
385 | 385 | ?> |
@@ -389,14 +389,14 @@ discard block |
||
389 | 389 | <div class="nav-links pager row"> |
390 | 390 | <div class="previous col-md-6"> |
391 | 391 | <?php |
392 | - $previous_post = get_previous_post_link( '%link', '<p class="nav-links-description">'._x( 'Previous Post', 'Previous post link', 'lsx' ).'</p><h3>%title</h3>' ); |
|
393 | - echo wp_kses_post( $previous_post ); |
|
392 | + $previous_post = get_previous_post_link('%link', '<p class="nav-links-description">' . _x('Previous Post', 'Previous post link', 'lsx') . '</p><h3>%title</h3>'); |
|
393 | + echo wp_kses_post($previous_post); |
|
394 | 394 | ?> |
395 | 395 | </div> |
396 | 396 | <div class="next col-md-6"> |
397 | 397 | <?php |
398 | - $next_post = get_next_post_link( '%link', '<p class="nav-links-description">'._x( 'Next Post', 'Next post link', 'lsx' ).'</p><h3>%title</h3>' ); |
|
399 | - echo wp_kses_post( $next_post ); |
|
398 | + $next_post = get_next_post_link('%link', '<p class="nav-links-description">' . _x('Next Post', 'Next post link', 'lsx') . '</p><h3>%title</h3>'); |
|
399 | + echo wp_kses_post($next_post); |
|
400 | 400 | ?> |
401 | 401 | </div> |
402 | 402 | </div><!-- .nav-links --> |
@@ -412,16 +412,16 @@ discard block |
||
412 | 412 | * @subpackage template-tags |
413 | 413 | * @category header |
414 | 414 | */ |
415 | -if(!function_exists('lsx_site_identity')){ |
|
416 | - function lsx_site_identity(){ |
|
415 | +if ( ! function_exists('lsx_site_identity')) { |
|
416 | + function lsx_site_identity() { |
|
417 | 417 | |
418 | - if ( function_exists('has_custom_logo') && has_custom_logo() ) { |
|
418 | + if (function_exists('has_custom_logo') && has_custom_logo()) { |
|
419 | 419 | the_custom_logo(); |
420 | - }elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { |
|
420 | + }elseif (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) { |
|
421 | 421 | jetpack_the_site_logo(); |
422 | - }else{ |
|
422 | + } else { |
|
423 | 423 | // shouldn't show both together.. its just strange |
424 | - if(true == get_theme_mod('site_logo_header_text',1)){ |
|
424 | + if (true == get_theme_mod('site_logo_header_text', 1)) { |
|
425 | 425 | lsx_site_title(); |
426 | 426 | } |
427 | 427 | } |
@@ -436,29 +436,29 @@ discard block |
||
436 | 436 | * @subpackage template-tags |
437 | 437 | * @category navigation |
438 | 438 | */ |
439 | -if(!function_exists('lsx_navbar_header')){ |
|
440 | - function lsx_navbar_header(){ ?> |
|
439 | +if ( ! function_exists('lsx_navbar_header')) { |
|
440 | + function lsx_navbar_header() { ?> |
|
441 | 441 | <div class="navbar-header" itemscope itemtype="http://schema.org/WebPage"> |
442 | 442 | |
443 | 443 | <?php |
444 | - $nav_menu = get_theme_mod('nav_menu_locations',false); |
|
444 | + $nav_menu = get_theme_mod('nav_menu_locations', false); |
|
445 | 445 | //print_r(get_nav_menu_locations()); |
446 | 446 | |
447 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
447 | + if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?> |
|
448 | 448 | <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".primary-navbar"> |
449 | - <span class="sr-only"><?php esc_html_e( 'Toggle navigation', 'lsx' ); ?></span> |
|
449 | + <span class="sr-only"><?php esc_html_e('Toggle navigation', 'lsx'); ?></span> |
|
450 | 450 | <span class="icon-bar"></span> |
451 | 451 | <span class="icon-bar"></span> |
452 | 452 | <span class="icon-bar"></span> |
453 | 453 | </button> |
454 | - <span class="mobile-menu-title"><?php esc_html_e( 'Menu', 'lsx' ); ?></span> |
|
454 | + <span class="mobile-menu-title"><?php esc_html_e('Menu', 'lsx'); ?></span> |
|
455 | 455 | <?php } ?> |
456 | 456 | <?php lsx_site_identity(); ?> |
457 | 457 | </div> |
458 | 458 | <?php } |
459 | 459 | } |
460 | 460 | //the if statement is for backwards compatability with previous versions of the theme. |
461 | -add_action('lsx_nav_before','lsx_navbar_header'); |
|
461 | +add_action('lsx_nav_before', 'lsx_navbar_header'); |
|
462 | 462 | |
463 | 463 | /** |
464 | 464 | * Outputs the Nav Menu |
@@ -467,16 +467,16 @@ discard block |
||
467 | 467 | * @subpackage template-tags |
468 | 468 | * @category navigation |
469 | 469 | */ |
470 | -if(!function_exists('lsx_nav_menu')){ |
|
471 | - function lsx_nav_menu(){ |
|
472 | - $nav_menu = get_theme_mod('nav_menu_locations',false); |
|
470 | +if ( ! function_exists('lsx_nav_menu')) { |
|
471 | + function lsx_nav_menu() { |
|
472 | + $nav_menu = get_theme_mod('nav_menu_locations', false); |
|
473 | 473 | |
474 | 474 | //print_r(get_nav_menu_locations()); |
475 | 475 | |
476 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
476 | + if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?> |
|
477 | 477 | <nav class="primary-navbar collapse navbar-collapse"> |
478 | 478 | <?php |
479 | - wp_nav_menu( array( |
|
479 | + wp_nav_menu(array( |
|
480 | 480 | 'theme_location' => 'primary', |
481 | 481 | 'menu' => $nav_menu['primary'], |
482 | 482 | 'depth' => 3, |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | * @subpackage template-tags |
498 | 498 | * @category sitemap |
499 | 499 | */ |
500 | -function lsx_sitemap_pages(){ |
|
500 | +function lsx_sitemap_pages() { |
|
501 | 501 | $page_args = array( |
502 | 502 | 'post_type' => 'page', |
503 | 503 | 'posts_per_page'=> 99, |
@@ -505,13 +505,13 @@ discard block |
||
505 | 505 | 'post_type' => 'page', |
506 | 506 | ); |
507 | 507 | $pages = new WP_Query($page_args); |
508 | - if($pages->have_posts()){ |
|
508 | + if ($pages->have_posts()) { |
|
509 | 509 | |
510 | - echo '<h2>' . esc_html__( 'Pages', 'lsx' ) . '</h2>'; |
|
510 | + echo '<h2>' . esc_html__('Pages', 'lsx') . '</h2>'; |
|
511 | 511 | |
512 | 512 | echo '<ul>'; |
513 | - while($pages->have_posts()){ $pages->the_post(); |
|
514 | - echo '<li class="page_item page-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>'; |
|
513 | + while ($pages->have_posts()) { $pages->the_post(); |
|
514 | + echo '<li class="page_item page-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>'; |
|
515 | 515 | } |
516 | 516 | echo '</ul>'; |
517 | 517 | |
@@ -526,13 +526,13 @@ discard block |
||
526 | 526 | * @subpackage template-tags |
527 | 527 | * @category sitemap |
528 | 528 | */ |
529 | -function lsx_sitemap_custom_post_type(){ |
|
529 | +function lsx_sitemap_custom_post_type() { |
|
530 | 530 | $args = array( |
531 | 531 | 'public' => true, |
532 | 532 | '_builtin' => false |
533 | 533 | ); |
534 | - $post_types = get_post_types($args , 'names'); |
|
535 | - foreach($post_types as $post_type){ |
|
534 | + $post_types = get_post_types($args, 'names'); |
|
535 | + foreach ($post_types as $post_type) { |
|
536 | 536 | |
537 | 537 | $post_type_args = array( |
538 | 538 | 'post_type' => 'page', |
@@ -543,19 +543,19 @@ discard block |
||
543 | 543 | $post_type_items = new WP_Query($post_type_args); |
544 | 544 | |
545 | 545 | $post_type_object = get_post_type_object($post_type); |
546 | - if(null != $post_type_object){ |
|
546 | + if (null != $post_type_object) { |
|
547 | 547 | $title = $post_type_object->labels->name; |
548 | - }else{ |
|
548 | + } else { |
|
549 | 549 | $title = ucwords($post_type); |
550 | 550 | } |
551 | 551 | |
552 | - if($post_type_items->have_posts()){ |
|
552 | + if ($post_type_items->have_posts()) { |
|
553 | 553 | |
554 | - echo '<h2>' . esc_html( $title ) . '</h2>'; |
|
554 | + echo '<h2>' . esc_html($title) . '</h2>'; |
|
555 | 555 | |
556 | 556 | echo '<ul>'; |
557 | - while($post_type_items->have_posts()){ $post_type_items->the_post(); |
|
558 | - 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>'; |
|
557 | + while ($post_type_items->have_posts()) { $post_type_items->the_post(); |
|
558 | + 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>'; |
|
559 | 559 | } |
560 | 560 | echo '</ul>'; |
561 | 561 | |
@@ -571,20 +571,20 @@ discard block |
||
571 | 571 | * @subpackage template-tags |
572 | 572 | * @category sitemap |
573 | 573 | */ |
574 | -function lsx_sitemap_taxonomy_clouds(){ |
|
574 | +function lsx_sitemap_taxonomy_clouds() { |
|
575 | 575 | |
576 | - $taxonomy_args = array( |
|
576 | + $taxonomy_args = array( |
|
577 | 577 | 'public' => true, |
578 | 578 | '_builtin' => false |
579 | 579 | ); |
580 | 580 | $taxonomies = get_taxonomies($taxonomy_args); |
581 | - if(!empty($taxonomies)){ |
|
582 | - foreach($taxonomies as $taxonomy_id => $taxonomy) { |
|
581 | + if ( ! empty($taxonomies)) { |
|
582 | + foreach ($taxonomies as $taxonomy_id => $taxonomy) { |
|
583 | 583 | |
584 | - $tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id,'echo'=>false)); |
|
585 | - if(null != $tag_cloud){ |
|
586 | - echo '<h2>' . esc_html( $taxonomy ) . '</h2>'; |
|
587 | - echo '<aside id="' . esc_attr( $taxonomy_id ) . '" class="widget widget_' . esc_attr( $taxonomy_id ) . '">' . esc_html( $tag_cloud ) . '</aside>'; |
|
584 | + $tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id, 'echo'=>false)); |
|
585 | + if (null != $tag_cloud) { |
|
586 | + echo '<h2>' . esc_html($taxonomy) . '</h2>'; |
|
587 | + echo '<aside id="' . esc_attr($taxonomy_id) . '" class="widget widget_' . esc_attr($taxonomy_id) . '">' . esc_html($tag_cloud) . '</aside>'; |
|
588 | 588 | } |
589 | 589 | } |
590 | 590 | } |
@@ -597,15 +597,15 @@ discard block |
||
597 | 597 | * @subpackage hooks |
598 | 598 | * @category forms |
599 | 599 | */ |
600 | -add_action( 'lsx_footer_before', 'lsx_footer_subscription_cta', 10 ); |
|
600 | +add_action('lsx_footer_before', 'lsx_footer_subscription_cta', 10); |
|
601 | 601 | function lsx_footer_subscription_cta() { |
602 | - if(!function_exists('lsx_is_form_enabled')){ return; } |
|
602 | + if ( ! function_exists('lsx_is_form_enabled')) { return; } |
|
603 | 603 | $subscribe_form_id = lsx_is_form_enabled('subscribe'); |
604 | - if(false == $subscribe_form_id) { return; } |
|
604 | + if (false == $subscribe_form_id) { return; } |
|
605 | 605 | |
606 | 606 | //add Caldera Forms Fields Scripts |
607 | - if( defined( 'CFCORE_VER' ) ){ |
|
608 | - wp_enqueue_script( 'cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER ); |
|
607 | + if (defined('CFCORE_VER')) { |
|
608 | + wp_enqueue_script('cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER); |
|
609 | 609 | } |
610 | 610 | |
611 | 611 | ?> |
@@ -613,8 +613,8 @@ discard block |
||
613 | 613 | <div class="container"> |
614 | 614 | <div class="row"> |
615 | 615 | <div class="col-md-12"> |
616 | - <h2><?php esc_html_e( 'Subscribe to Our Newsletter', 'lsx' ); ?></h2> |
|
617 | - <?php echo do_shortcode( '[caldera_form id="'.$subscribe_form_id.'"]' ); ?> |
|
616 | + <h2><?php esc_html_e('Subscribe to Our Newsletter', 'lsx'); ?></h2> |
|
617 | + <?php echo do_shortcode('[caldera_form id="' . $subscribe_form_id . '"]'); ?> |
|
618 | 618 | </div> |
619 | 619 | </div> |
620 | 620 | </div> |
@@ -630,13 +630,13 @@ discard block |
||
630 | 630 | * @category menu |
631 | 631 | */ |
632 | 632 | function lsx_add_top_menu() { |
633 | - if ( has_nav_menu( 'top-menu' ) || has_nav_menu(' top-menu-left' ) ) : ?> |
|
633 | + if (has_nav_menu('top-menu') || has_nav_menu(' top-menu-left')) : ?> |
|
634 | 634 | <div id="top-menu" class="<?php lsx_top_menu_classes(); ?>"> |
635 | 635 | <div class="container"> |
636 | - <?php if ( has_nav_menu( 'top-menu' ) ) : ?> |
|
636 | + <?php if (has_nav_menu('top-menu')) : ?> |
|
637 | 637 | <nav class="top-menu"> |
638 | 638 | <?php |
639 | - wp_nav_menu( array( |
|
639 | + wp_nav_menu(array( |
|
640 | 640 | 'theme_location' => 'top-menu', |
641 | 641 | 'walker' => new Lsx_Bootstrap_Navwalker()) |
642 | 642 | ); |
@@ -644,10 +644,10 @@ discard block |
||
644 | 644 | </nav> |
645 | 645 | <?php endif; ?> |
646 | 646 | |
647 | - <?php if ( has_nav_menu( 'top-menu-left' ) ) : ?> |
|
647 | + <?php if (has_nav_menu('top-menu-left')) : ?> |
|
648 | 648 | <nav class="top-menu pull-left"> |
649 | 649 | <?php |
650 | - wp_nav_menu( array( |
|
650 | + wp_nav_menu(array( |
|
651 | 651 | 'theme_location' => 'top-menu-left', |
652 | 652 | 'walker' => new Lsx_Bootstrap_Navwalker()) |
653 | 653 | ); |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | </div> |
659 | 659 | <?php endif; |
660 | 660 | } |
661 | -add_action( 'lsx_header_top', 'lsx_add_top_menu' ); |
|
661 | +add_action('lsx_header_top', 'lsx_add_top_menu'); |
|
662 | 662 | |
663 | 663 | /** |
664 | 664 | * Checks if a caldera form with your slug exists |
@@ -667,24 +667,24 @@ discard block |
||
667 | 667 | * @subpackage template-tag |
668 | 668 | * @category forms |
669 | 669 | */ |
670 | -if ( class_exists('Caldera_Forms') && !function_exists( 'lsx_is_form_enabled' ) ) { |
|
670 | +if (class_exists('Caldera_Forms') && ! function_exists('lsx_is_form_enabled')) { |
|
671 | 671 | function lsx_is_form_enabled($slug = false) { |
672 | - if(false == $slug){ return false; } |
|
672 | + if (false == $slug) { return false; } |
|
673 | 673 | |
674 | 674 | $match = false; |
675 | - $forms = get_option( '_caldera_forms' , false ); |
|
676 | - if(false !== $forms ) { |
|
677 | - foreach($forms as $form_id=>$form_maybe){ |
|
678 | - if( trim(strtolower($slug)) == strtolower($form_maybe['name']) ){ |
|
675 | + $forms = get_option('_caldera_forms', false); |
|
676 | + if (false !== $forms) { |
|
677 | + foreach ($forms as $form_id=>$form_maybe) { |
|
678 | + if (trim(strtolower($slug)) == strtolower($form_maybe['name'])) { |
|
679 | 679 | $match = $form_id; |
680 | 680 | break; |
681 | 681 | } |
682 | 682 | } |
683 | 683 | } |
684 | - if( false === $match ){ |
|
685 | - $is_form = Caldera_Forms::get_form( strtolower( $slug ) ); |
|
686 | - if( !empty( $is_form ) ){ |
|
687 | - return strtolower( $slug ); |
|
684 | + if (false === $match) { |
|
685 | + $is_form = Caldera_Forms::get_form(strtolower($slug)); |
|
686 | + if ( ! empty($is_form)) { |
|
687 | + return strtolower($slug); |
|
688 | 688 | } |
689 | 689 | } |
690 | 690 | |
@@ -700,10 +700,10 @@ discard block |
||
700 | 700 | * @category urls |
701 | 701 | */ |
702 | 702 | function lsx_get_my_url() { |
703 | - if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) |
|
703 | + if ( ! preg_match('/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches)) |
|
704 | 704 | return false; |
705 | 705 | |
706 | - return esc_url_raw( $matches[1] ); |
|
706 | + return esc_url_raw($matches[1]); |
|
707 | 707 | } |
708 | 708 | |
709 | 709 | /** |
@@ -713,19 +713,19 @@ discard block |
||
713 | 713 | * @subpackage extras |
714 | 714 | * @category urls |
715 | 715 | */ |
716 | -function lsx_get_template_part($slug,$part) { |
|
716 | +function lsx_get_template_part($slug, $part) { |
|
717 | 717 | $template = array(); |
718 | 718 | $part = (string) $part; |
719 | - if ( '' !== $part ){ |
|
719 | + if ('' !== $part) { |
|
720 | 720 | $template = "{$slug}-{$part}.php"; |
721 | - }else{ |
|
721 | + } else { |
|
722 | 722 | $template = "{$slug}.php"; |
723 | 723 | } |
724 | - $file_path = apply_filters('lsx_content_path',false,$slug,$part); |
|
724 | + $file_path = apply_filters('lsx_content_path', false, $slug, $part); |
|
725 | 725 | |
726 | - if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) { |
|
727 | - load_template( $file_path.$template, false ); |
|
728 | - }else{ |
|
729 | - get_template_part($slug,$part); |
|
726 | + if (false !== $file_path && '' == locate_template(array($template)) && file_exists($file_path . $template)) { |
|
727 | + load_template($file_path . $template, false); |
|
728 | + } else { |
|
729 | + get_template_part($slug, $part); |
|
730 | 730 | } |
731 | 731 | } |
732 | 732 | \ No newline at end of file |