@@ -125,7 +125,7 @@ |
||
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 | 130 | add_action( 'wp_enqueue_scripts', 'lsx_sensei_styles' ); |
131 | 131 |
@@ -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 |
@@ -7,21 +7,21 @@ 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 | - $grid_layout_enabled = ( ! is_singular() && apply_filters( 'lsx_blog_grid_layout', false ) ); |
|
16 | + $grid_layout_enabled = ( ! is_singular() && apply_filters('lsx_blog_grid_layout', false)); |
|
17 | 17 | $image_src = ''; |
18 | 18 | $image_class = ''; |
19 | 19 | |
20 | - if ( true === $grid_layout_enabled ) { |
|
21 | - $thumbnail_id = get_post_thumbnail_id( get_the_ID() ); |
|
22 | - $image_arr = wp_get_attachment_image_src( $thumbnail_id, 'lsx-single-thumbnail' ); |
|
20 | + if (true === $grid_layout_enabled) { |
|
21 | + $thumbnail_id = get_post_thumbnail_id(get_the_ID()); |
|
22 | + $image_arr = wp_get_attachment_image_src($thumbnail_id, 'lsx-single-thumbnail'); |
|
23 | 23 | |
24 | - if ( is_array( $image_arr ) ) { |
|
24 | + if (is_array($image_arr)) { |
|
25 | 25 | $image_src = $image_arr[0]; |
26 | 26 | } |
27 | 27 | |
@@ -29,24 +29,24 @@ discard block |
||
29 | 29 | } |
30 | 30 | ?> |
31 | 31 | |
32 | -<article id="post-<?php the_ID(); ?>" <?php post_class( $thumb_class ); ?>> |
|
32 | +<article id="post-<?php the_ID(); ?>" <?php post_class($thumb_class); ?>> |
|
33 | 33 | <?php lsx_entry_top(); ?> |
34 | 34 | |
35 | - <?php if ( true === $grid_layout_enabled ) { ?> |
|
35 | + <?php if (true === $grid_layout_enabled) { ?> |
|
36 | 36 | <div class="entry-grid-layout"> |
37 | 37 | <?php } ?> |
38 | 38 | |
39 | - <?php if ( has_post_thumbnail() && true === $grid_layout_enabled ) { ?> |
|
39 | + <?php if (has_post_thumbnail() && true === $grid_layout_enabled) { ?> |
|
40 | 40 | <div class="entry-grid-layout-content entry-grid-layout-content-67"> |
41 | 41 | <?php } ?> |
42 | 42 | |
43 | - <?php if ( ! has_post_thumbnail() && true === $grid_layout_enabled ) { ?> |
|
43 | + <?php if ( ! has_post_thumbnail() && true === $grid_layout_enabled) { ?> |
|
44 | 44 | <div class="entry-grid-layout-content entry-grid-layout-content-100"> |
45 | 45 | <?php } ?> |
46 | 46 | |
47 | 47 | <header class="entry-header"> |
48 | - <?php if ( has_post_thumbnail() ) { ?> |
|
49 | - <div class="entry-image <?php echo esc_attr( $image_class ); ?>"> |
|
48 | + <?php if (has_post_thumbnail()) { ?> |
|
49 | + <div class="entry-image <?php echo esc_attr($image_class); ?>"> |
|
50 | 50 | <a class="thumbnail" href="<?php the_permalink(); ?>"> |
51 | 51 | <?php lsx_thumbnail('lsx-single-thumbnail'); ?> |
52 | 52 | </a> |
@@ -55,35 +55,35 @@ discard block |
||
55 | 55 | |
56 | 56 | <?php |
57 | 57 | $format = get_post_format(); |
58 | - if ( false === $format ) { |
|
58 | + if (false === $format) { |
|
59 | 59 | $format = 'standard'; |
60 | - $show_on_front = get_option('show_on_front','posts'); |
|
61 | - if('page' == $show_on_front){ |
|
60 | + $show_on_front = get_option('show_on_front', 'posts'); |
|
61 | + if ('page' == $show_on_front) { |
|
62 | 62 | $archive_link = get_permalink(get_option('page_for_posts')); |
63 | - }else{ |
|
63 | + } else { |
|
64 | 64 | $archive_link = home_url(); |
65 | 65 | } |
66 | - }else{ |
|
66 | + } else { |
|
67 | 67 | $archive_link = get_post_format_link($format); |
68 | 68 | } |
69 | 69 | $format = lsx_translate_format_to_fontawesome($format); |
70 | 70 | ?> |
71 | 71 | |
72 | 72 | <h1 class="entry-title"> |
73 | - <?php if ( has_post_thumbnail() ) { ?> |
|
74 | - <a href="<?php echo esc_url($archive_link) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
73 | + <?php if (has_post_thumbnail()) { ?> |
|
74 | + <a href="<?php echo esc_url($archive_link) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr($format) ?>"></a> |
|
75 | 75 | <?php } else { ?> |
76 | - <a href="<?php echo esc_url($archive_link) ?>" class="format-link fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
76 | + <a href="<?php echo esc_url($archive_link) ?>" class="format-link fa fa-<?php echo esc_attr($format) ?>"></a> |
|
77 | 77 | <?php } ?> |
78 | 78 | |
79 | - <?php if ( has_post_format( array('link') ) ) { ?> |
|
80 | - <a href="<?php echo esc_url( lsx_get_my_url() ); ?>" rel="bookmark"><?php the_title(); ?> <span class="fa fa-external-link"></span></a> |
|
79 | + <?php if (has_post_format(array('link'))) { ?> |
|
80 | + <a href="<?php echo esc_url(lsx_get_my_url()); ?>" rel="bookmark"><?php the_title(); ?> <span class="fa fa-external-link"></span></a> |
|
81 | 81 | <?php } else { ?> |
82 | 82 | <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> |
83 | 83 | <?php } ?> |
84 | 84 | |
85 | - <?php if ( is_sticky() ) { ?> |
|
86 | - <span class="label label-default label-sticky"><?php esc_html_e('Featured','lsx'); ?></span> |
|
85 | + <?php if (is_sticky()) { ?> |
|
86 | + <span class="label label-default label-sticky"><?php esc_html_e('Featured', 'lsx'); ?></span> |
|
87 | 87 | <?php } ?> |
88 | 88 | </h1> |
89 | 89 | |
@@ -92,13 +92,13 @@ discard block |
||
92 | 92 | </div><!-- .entry-meta --> |
93 | 93 | </header><!-- .entry-header --> |
94 | 94 | |
95 | - <?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 ?> |
|
95 | + <?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 ?> |
|
96 | 96 | <div class="entry-summary"> |
97 | 97 | <?php the_excerpt(); ?> |
98 | 98 | </div><!-- .entry-summary --> |
99 | - <?php elseif ( has_post_format( array('link') ) ) : ?> |
|
99 | + <?php elseif (has_post_format(array('link'))) : ?> |
|
100 | 100 | |
101 | - <?php elseif ( apply_filters( 'lsx_blog_force_content_on_list', false ) ) : ?> |
|
101 | + <?php elseif (apply_filters('lsx_blog_force_content_on_list', false)) : ?> |
|
102 | 102 | <div class="entry-content"> |
103 | 103 | <?php the_content(); ?> |
104 | 104 | </div><!-- .entry-content --> |
@@ -107,44 +107,44 @@ discard block |
||
107 | 107 | <?php |
108 | 108 | the_content(); |
109 | 109 | |
110 | - wp_link_pages( array( |
|
110 | + wp_link_pages(array( |
|
111 | 111 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
112 | 112 | 'after' => '</div></div>', |
113 | 113 | 'link_before' => '<span>', |
114 | 114 | 'link_after' => '</span>' |
115 | - ) ); |
|
115 | + )); |
|
116 | 116 | ?> |
117 | 117 | </div><!-- .entry-content --> |
118 | 118 | <?php endif; ?> |
119 | 119 | |
120 | - <?php if ( true === $grid_layout_enabled ) { ?> |
|
120 | + <?php if (true === $grid_layout_enabled) { ?> |
|
121 | 121 | </div> |
122 | 122 | <?php } ?> |
123 | 123 | |
124 | - <?php if ( has_post_thumbnail() && true === $grid_layout_enabled ) { ?> |
|
124 | + <?php if (has_post_thumbnail() && true === $grid_layout_enabled) { ?> |
|
125 | 125 | <div class="entry-image hidden-xs"> |
126 | - <a class="thumbnail" href="<?php the_permalink(); ?>" style="background-image:url(<?php echo esc_url( $image_src ); ?>);"> |
|
127 | - <?php lsx_thumbnail( 'lsx-single-thumbnail' ); ?> |
|
126 | + <a class="thumbnail" href="<?php the_permalink(); ?>" style="background-image:url(<?php echo esc_url($image_src); ?>);"> |
|
127 | + <?php lsx_thumbnail('lsx-single-thumbnail'); ?> |
|
128 | 128 | </a> |
129 | 129 | </div> |
130 | 130 | <?php } ?> |
131 | 131 | |
132 | - <?php if ( true === $grid_layout_enabled ) { ?> |
|
132 | + <?php if (true === $grid_layout_enabled) { ?> |
|
133 | 133 | </div> |
134 | 134 | <?php } ?> |
135 | 135 | |
136 | 136 | <div class="clearfix"></div> |
137 | 137 | |
138 | - <?php if ( has_tag() || ( comments_open() && ! empty( get_comments_number() ) ) ) : ?> |
|
138 | + <?php if (has_tag() || (comments_open() && ! empty(get_comments_number()))) : ?> |
|
139 | 139 | <div class="post-tags-wrapper"> |
140 | 140 | <?php lsx_content_post_tags(); ?> |
141 | 141 | |
142 | - <?php if ( comments_open() && 0 != get_comments_number() ) : ?> |
|
142 | + <?php if (comments_open() && 0 != get_comments_number()) : ?> |
|
143 | 143 | <div class="post-comments"> |
144 | 144 | <a href="<?php the_permalink() ?>#comments"> |
145 | 145 | <?php |
146 | 146 | $count = get_comments_number(); |
147 | - printf( esc_html( _n( 'One Comment', '%1$s Comments', $count, 'lsx' ) ), esc_html( number_format_i18n( $count ) ) ); |
|
147 | + printf(esc_html(_n('One Comment', '%1$s Comments', $count, 'lsx')), esc_html(number_format_i18n($count))); |
|
148 | 148 | ?> |
149 | 149 | </a> |
150 | 150 | </div> |
@@ -156,9 +156,9 @@ discard block |
||
156 | 156 | |
157 | 157 | <div class="clearfix"></div> |
158 | 158 | |
159 | - <?php edit_post_link( esc_html__( 'Edit', 'lsx' ), '<span class="edit-link">', '</span>' ); ?> |
|
159 | + <?php edit_post_link(esc_html__('Edit', 'lsx'), '<span class="edit-link">', '</span>'); ?> |
|
160 | 160 | |
161 | - <?php if ( !is_singular() && !is_single() ) { // Display full-width divider on Archives ?> |
|
161 | + <?php if ( ! is_singular() && ! is_single()) { // Display full-width divider on Archives ?> |
|
162 | 162 | <div class="lsx-breaker"></div> |
163 | 163 | <?php } ?> |
164 | 164 | </article><!-- #post-## --> |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | $show_on_front = get_option('show_on_front','posts'); |
61 | 61 | if('page' == $show_on_front){ |
62 | 62 | $archive_link = get_permalink(get_option('page_for_posts')); |
63 | - }else{ |
|
63 | + } else{ |
|
64 | 64 | $archive_link = home_url(); |
65 | 65 | } |
66 | - }else{ |
|
66 | + } else{ |
|
67 | 67 | $archive_link = get_post_format_link($format); |
68 | 68 | } |
69 | 69 | $format = lsx_translate_format_to_fontawesome($format); |
@@ -102,10 +102,12 @@ discard block |
||
102 | 102 | <div class="entry-content"> |
103 | 103 | <?php the_content(); ?> |
104 | 104 | </div><!-- .entry-content --> |
105 | - <?php else : ?> |
|
105 | + <?php else { |
|
106 | + : ?> |
|
106 | 107 | <div class="entry-content"> |
107 | 108 | <?php |
108 | 109 | the_content(); |
110 | +} |
|
109 | 111 | |
110 | 112 | wp_link_pages( array( |
111 | 113 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |