@@ -9,47 +9,47 @@ discard block |
||
9 | 9 | |
10 | 10 | <div class="row"> |
11 | 11 | <div class="col-md-6"> |
12 | - <h1><?php echo esc_html__( 'LSX', 'lsx' ) . ' <sup class="version">' . esc_attr( LSX_VERSION ) . '</sup>'; ?></h1> |
|
12 | + <h1><?php echo esc_html__('LSX', 'lsx') . ' <sup class="version">' . esc_attr(LSX_VERSION) . '</sup>'; ?></h1> |
|
13 | 13 | </div> |
14 | 14 | |
15 | 15 | <div class="col-md-6"> |
16 | - <p class="review"><?php echo sprintf( esc_html__( '%1$sEnjoying LSX?%2$s Why not %3$sleave a review%4$s on WordPress.org? We\'re looking foward to all our users\' feedback!', 'lsx' ), '<strong>', '</strong>', '<a href="https://wordpress.org/themes/lsx" target="_blank">', '</a>' ); ?></p> |
|
16 | + <p class="review"><?php echo sprintf(esc_html__('%1$sEnjoying LSX?%2$s Why not %3$sleave a review%4$s on WordPress.org? We\'re looking foward to all our users\' feedback!', 'lsx'), '<strong>', '</strong>', '<a href="https://wordpress.org/themes/lsx" target="_blank">', '</a>'); ?></p> |
|
17 | 17 | </div> |
18 | 18 | </div> |
19 | 19 | |
20 | 20 | <div class="row"> |
21 | 21 | <div class="col-md-6"> |
22 | 22 | <div class="box enrich"> |
23 | - <h2><?php esc_html_e( 'Built to enrich your WordPress experience', 'lsx' ); ?></h2> |
|
24 | - <p><?php esc_html_e( 'Whether you\'re using LSX for your personal blog, as the platform for a powerful WooCommerce store or as the foundation for your own child-theme, you\'ll find it\'s the perfect fit for WordPress.', 'lsx' ); ?></p> |
|
23 | + <h2><?php esc_html_e('Built to enrich your WordPress experience', 'lsx'); ?></h2> |
|
24 | + <p><?php esc_html_e('Whether you\'re using LSX for your personal blog, as the platform for a powerful WooCommerce store or as the foundation for your own child-theme, you\'ll find it\'s the perfect fit for WordPress.', 'lsx'); ?></p> |
|
25 | 25 | </div> |
26 | 26 | </div> |
27 | 27 | |
28 | 28 | <div class="col-md-6"> |
29 | 29 | <div class="box news"> |
30 | - <h2><?php esc_html_e( 'LSX News & Documentation', 'lsx' ); ?></h2> |
|
30 | + <h2><?php esc_html_e('LSX News & Documentation', 'lsx'); ?></h2> |
|
31 | 31 | |
32 | 32 | <div class="row"> |
33 | 33 | <div class="col-md-6 news"> |
34 | - <h3><?php esc_html_e( 'Recent News', 'lsx' ); ?></h3> |
|
34 | + <h3><?php esc_html_e('Recent News', 'lsx'); ?></h3> |
|
35 | 35 | |
36 | 36 | <ul> |
37 | 37 | <?php |
38 | - $rss = fetch_feed( 'https://www.lsdev.biz/lsx/feed/' ); |
|
38 | + $rss = fetch_feed('https://www.lsdev.biz/lsx/feed/'); |
|
39 | 39 | $rss_items = array(); |
40 | 40 | |
41 | - if ( ! is_wp_error( $rss ) ) { |
|
42 | - $maxitems = $rss->get_item_quantity( 3 ); |
|
43 | - $rss_items = $rss->get_items( 0, $maxitems ); |
|
41 | + if ( ! is_wp_error($rss)) { |
|
42 | + $maxitems = $rss->get_item_quantity(3); |
|
43 | + $rss_items = $rss->get_items(0, $maxitems); |
|
44 | 44 | } |
45 | 45 | |
46 | - foreach ( $rss_items as $item ) : ?> |
|
46 | + foreach ($rss_items as $item) : ?> |
|
47 | 47 | <li> |
48 | - <a href="<?php echo esc_url( $item->get_permalink() ); ?>" target="_blank"> |
|
49 | - <?php echo esc_html( $item->get_title() ); ?> |
|
48 | + <a href="<?php echo esc_url($item->get_permalink()); ?>" target="_blank"> |
|
49 | + <?php echo esc_html($item->get_title()); ?> |
|
50 | 50 | </a> |
51 | 51 | </li> |
52 | - <span class="date"><?php echo esc_attr( $item->get_date( 'j F Y' ) ); ?></span> |
|
52 | + <span class="date"><?php echo esc_attr($item->get_date('j F Y')); ?></span> |
|
53 | 53 | <?php |
54 | 54 | endforeach; |
55 | 55 | ?> |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | </div> |
58 | 58 | |
59 | 59 | <div class="col-md-6 docs"> |
60 | - <h3><?php esc_html_e( 'Documentation', 'lsx' ); ?></h3> |
|
60 | + <h3><?php esc_html_e('Documentation', 'lsx'); ?></h3> |
|
61 | 61 | |
62 | 62 | <ul> |
63 | 63 | <li> |
64 | - <a href="https://www.lsdev.biz/documentation/lsx/" target="_blank"><?php esc_html_e( 'Installation & configuration', 'lsx' ); ?></a> |
|
64 | + <a href="https://www.lsdev.biz/documentation/lsx/" target="_blank"><?php esc_html_e('Installation & configuration', 'lsx'); ?></a> |
|
65 | 65 | </li> |
66 | 66 | </ul> |
67 | 67 | </div> |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | <div class="row"> |
11 | 11 | <div class="col-md-4"> |
12 | 12 | <div class="box customise"> |
13 | - <h2><?php esc_html_e( 'Theme Customizer', 'lsx' ); ?> - <span class="price">$59.00</span></h2> |
|
14 | - <p><?php esc_html_e( 'You\'ve installed LSX, so now why not make it all yours? Whether it\'s a small CSS tweak or changing the entire layout of pages, posts or archives, please make use of the Theme Customizer plugin. Click below to install and get custom!', 'lsx' ); ?></p> |
|
13 | + <h2><?php esc_html_e('Theme Customizer', 'lsx'); ?> - <span class="price">$59.00</span></h2> |
|
14 | + <p><?php esc_html_e('You\'ve installed LSX, so now why not make it all yours? Whether it\'s a small CSS tweak or changing the entire layout of pages, posts or archives, please make use of the Theme Customizer plugin. Click below to install and get custom!', 'lsx'); ?></p> |
|
15 | 15 | |
16 | 16 | <div class="more-button"> |
17 | 17 | <a href="https://www.lsdev.biz/product/lsx-theme-customizer/" target="_blank" class="button button-primary"> |
18 | - <?php esc_html_e( 'Theme Customizer', 'lsx' ); ?> |
|
18 | + <?php esc_html_e('Theme Customizer', 'lsx'); ?> |
|
19 | 19 | </a> |
20 | 20 | </div> |
21 | 21 | </div> |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | |
24 | 24 | <div class="col-md-4"> |
25 | 25 | <div class="box support"> |
26 | - <h2><?php esc_html_e( 'Get support', 'lsx' ); ?></h2> |
|
27 | - <p><?php printf( esc_html__( 'You\'ll find information on how to use and customize the LSX theme in our %1$sdocumentation%2$s section. However, please do %3$scontact us%4$s for support should you still find yourself unable to achieve your needs.', 'lsx' ), '<a href="https://www.lsdev.biz/documentation/lsx/" target="_blank">', '</a>', '<a href="https://www.lsdev.biz/contact-us/" target="_blank">', '</a>' ); ?></p> |
|
26 | + <h2><?php esc_html_e('Get support', 'lsx'); ?></h2> |
|
27 | + <p><?php printf(esc_html__('You\'ll find information on how to use and customize the LSX theme in our %1$sdocumentation%2$s section. However, please do %3$scontact us%4$s for support should you still find yourself unable to achieve your needs.', 'lsx'), '<a href="https://www.lsdev.biz/documentation/lsx/" target="_blank">', '</a>', '<a href="https://www.lsdev.biz/contact-us/" target="_blank">', '</a>'); ?></p> |
|
28 | 28 | |
29 | 29 | <div class="more-button"> |
30 | 30 | <a href="https://www.lsdev.biz/contact-us/" target="_blank" class="button button-primary"> |
31 | - <?php esc_html_e( 'Get in touch', 'lsx' ); ?> |
|
31 | + <?php esc_html_e('Get in touch', 'lsx'); ?> |
|
32 | 32 | </a> |
33 | 33 | </div> |
34 | 34 | </div> |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | |
37 | 37 | <div class="col-md-4"> |
38 | 38 | <div class="box suggest"> |
39 | - <h2><?php esc_html_e( 'Suggest a feature', 'lsx' ); ?></h2> |
|
40 | - <p><?php printf( esc_html__( 'If you\'d like to suggest a feature for inclusion in upcoming releases of the LSX theme, please don\'t hesitate to %1$scontact us%2$s directly. We\'re always on the lookout for fresh ideas to help make LSX even better.', 'lsx' ), '<a href="https://www.lsdev.biz/contact-us/" target="_blank">', '</a>' ); ?></p> |
|
39 | + <h2><?php esc_html_e('Suggest a feature', 'lsx'); ?></h2> |
|
40 | + <p><?php printf(esc_html__('If you\'d like to suggest a feature for inclusion in upcoming releases of the LSX theme, please don\'t hesitate to %1$scontact us%2$s directly. We\'re always on the lookout for fresh ideas to help make LSX even better.', 'lsx'), '<a href="https://www.lsdev.biz/contact-us/" target="_blank">', '</a>'); ?></p> |
|
41 | 41 | |
42 | 42 | <div class="more-button"> |
43 | 43 | <a href="https://www.lsdev.biz/contact-us/" target="_blank" class="button button-primary"> |
44 | - <?php esc_html_e( 'Submit a request', 'lsx' ); ?> |
|
44 | + <?php esc_html_e('Submit a request', 'lsx'); ?> |
|
45 | 45 | </a> |
46 | 46 | </div> |
47 | 47 | </div> |
@@ -10,28 +10,28 @@ discard block |
||
10 | 10 | <div class="row"> |
11 | 11 | <div class="col-md-12"> |
12 | 12 | <div class="box enhance"> |
13 | - <h2><?php esc_html_e( 'Enhance LSX', 'lsx' ); ?></h2> |
|
14 | - <p><?php esc_html_e( 'Take a look at our range of extensions that add to the already rich functionality of the LSX WordPress theme..', 'lsx' ); ?></p> |
|
13 | + <h2><?php esc_html_e('Enhance LSX', 'lsx'); ?></h2> |
|
14 | + <p><?php esc_html_e('Take a look at our range of extensions that add to the already rich functionality of the LSX WordPress theme..', 'lsx'); ?></p> |
|
15 | 15 | |
16 | 16 | <div class="row"> |
17 | 17 | <div class="col-md-4"> |
18 | 18 | <div class="box-clean"> |
19 | - <a href="https://www.lsdev.biz/product/lsx-currencies/" target="_blank"><?php esc_html_e( 'Currencies', 'lsx' ); ?> - <span class="price">$59.00</span></a> |
|
20 | - <p><?php esc_html_e( 'The LSX Currencies extension adds currency selection functionality to sites, allowing users to view your products in whatever currencies you choose to sell in.', 'lsx' ); ?></p> |
|
19 | + <a href="https://www.lsdev.biz/product/lsx-currencies/" target="_blank"><?php esc_html_e('Currencies', 'lsx'); ?> - <span class="price">$59.00</span></a> |
|
20 | + <p><?php esc_html_e('The LSX Currencies extension adds currency selection functionality to sites, allowing users to view your products in whatever currencies you choose to sell in.', 'lsx'); ?></p> |
|
21 | 21 | </div> |
22 | 22 | </div> |
23 | 23 | |
24 | 24 | <div class="col-md-4"> |
25 | 25 | <div class="box-clean"> |
26 | - <a href="https://www.lsdev.biz/product/lsx-banners/" target="_blank"><?php esc_html_e( 'Banners', 'lsx' ); ?> - <span class="price">$49.00</span></a> |
|
27 | - <p><?php esc_html_e( 'The LSX Banners extension adds advanced banner configuration options to your WordPress site running LSX theme.', 'lsx' ); ?></p> |
|
26 | + <a href="https://www.lsdev.biz/product/lsx-banners/" target="_blank"><?php esc_html_e('Banners', 'lsx'); ?> - <span class="price">$49.00</span></a> |
|
27 | + <p><?php esc_html_e('The LSX Banners extension adds advanced banner configuration options to your WordPress site running LSX theme.', 'lsx'); ?></p> |
|
28 | 28 | </div> |
29 | 29 | </div> |
30 | 30 | |
31 | 31 | <div class="col-md-4"> |
32 | 32 | <div class="box-clean"> |
33 | - <a href="https://www.lsdev.biz/product/lsx-currencies/" target="_blank"><?php esc_html_e( 'Testimonials', 'lsx' ); ?> - <span class="price">$29.00</span></a> |
|
34 | - <p><?php esc_html_e( 'The LSX Testimonials extension adds the "Testimonials" post type, which you can display front-and-centre on your site.', 'lsx' ); ?></p> |
|
33 | + <a href="https://www.lsdev.biz/product/lsx-currencies/" target="_blank"><?php esc_html_e('Testimonials', 'lsx'); ?> - <span class="price">$29.00</span></a> |
|
34 | + <p><?php esc_html_e('The LSX Testimonials extension adds the "Testimonials" post type, which you can display front-and-centre on your site.', 'lsx'); ?></p> |
|
35 | 35 | </div> |
36 | 36 | </div> |
37 | 37 | </div> |
@@ -39,22 +39,22 @@ discard block |
||
39 | 39 | <div class="row"> |
40 | 40 | <div class="col-md-4"> |
41 | 41 | <div class="box-clean"> |
42 | - <a href="https://www.lsdev.biz/product/lsx-team/" target="_blank"><?php esc_html_e( 'Team', 'lsx' ); ?> - <span class="price">$29.00</span></a> |
|
43 | - <p><?php esc_html_e( 'The LSX Team Extension provides a custom post type that allows you to easily show off the people that make up your business.', 'lsx' ); ?></p> |
|
42 | + <a href="https://www.lsdev.biz/product/lsx-team/" target="_blank"><?php esc_html_e('Team', 'lsx'); ?> - <span class="price">$29.00</span></a> |
|
43 | + <p><?php esc_html_e('The LSX Team Extension provides a custom post type that allows you to easily show off the people that make up your business.', 'lsx'); ?></p> |
|
44 | 44 | </div> |
45 | 45 | </div> |
46 | 46 | |
47 | 47 | <div class="col-md-4"> |
48 | 48 | <div class="box-clean"> |
49 | - <a href="https://www.lsdev.biz/product/lsx-mega-menus/" target="_blank"><?php esc_html_e( 'Mega Menus', 'lsx' ); ?> - <span class="price">$39.00</span></a> |
|
50 | - <p><?php esc_html_e( 'Create custom, full-width dropdown menus that contain images, widgets and more that seamlessly tie into your LSX WordPress site.', 'lsx' ); ?></p> |
|
49 | + <a href="https://www.lsdev.biz/product/lsx-mega-menus/" target="_blank"><?php esc_html_e('Mega Menus', 'lsx'); ?> - <span class="price">$39.00</span></a> |
|
50 | + <p><?php esc_html_e('Create custom, full-width dropdown menus that contain images, widgets and more that seamlessly tie into your LSX WordPress site.', 'lsx'); ?></p> |
|
51 | 51 | </div> |
52 | 52 | </div> |
53 | 53 | |
54 | 54 | <div class="col-md-4"> |
55 | 55 | <div class="box-clean"> |
56 | - <a href="https://www.lsdev.biz/product/lsx-login/" target="_blank"><?php esc_html_e( 'Login', 'lsx' ); ?> - <span class="price">$59.00</span></a> |
|
57 | - <p><?php esc_html_e( 'The LSX Login extension allows users to log into a dashboard and then see configurable content based on which users can access which content.', 'lsx' ); ?></p> |
|
56 | + <a href="https://www.lsdev.biz/product/lsx-login/" target="_blank"><?php esc_html_e('Login', 'lsx'); ?> - <span class="price">$59.00</span></a> |
|
57 | + <p><?php esc_html_e('The LSX Login extension allows users to log into a dashboard and then see configurable content based on which users can access which content.', 'lsx'); ?></p> |
|
58 | 58 | </div> |
59 | 59 | </div> |
60 | 60 | </div> |
@@ -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 | * 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,83 +99,83 @@ 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 | - printf( '<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>', |
|
128 | - esc_html_x( 'Posted by:', 'Used before post author name.', 'lsx' ), |
|
129 | - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), |
|
127 | + printf('<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>', |
|
128 | + esc_html_x('Posted by:', 'Used before post author name.', 'lsx'), |
|
129 | + esc_url(get_author_posts_url(get_the_author_meta('ID'))), |
|
130 | 130 | get_the_author() |
131 | 131 | ); |
132 | 132 | } |
133 | 133 | } |
134 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_author', 20 ); |
|
134 | +add_action('lsx_content_post_meta', 'lsx_post_meta_author', 20); |
|
135 | 135 | |
136 | 136 | /** |
137 | 137 | * Add customisable post meta: post category(ies) |
138 | 138 | */ |
139 | -if ( ! function_exists( 'lsx_post_meta_category' ) ) { |
|
139 | +if ( ! function_exists('lsx_post_meta_category')) { |
|
140 | 140 | function lsx_post_meta_category() { |
141 | - $post_categories = wp_get_post_categories( get_the_ID() ); |
|
141 | + $post_categories = wp_get_post_categories(get_the_ID()); |
|
142 | 142 | $cats = array(); |
143 | 143 | |
144 | - foreach( $post_categories as $c ) { |
|
145 | - $cat = get_category( $c ); |
|
146 | - $cats[] = '<a href="' . get_category_link( $cat->term_id ) . '" title="' . sprintf( esc_html__( 'View all posts in %s' , 'lsx' ), $cat->name ) . '" ' . '>' . $cat->name . '</a>'; |
|
144 | + foreach ($post_categories as $c) { |
|
145 | + $cat = get_category($c); |
|
146 | + $cats[] = '<a href="' . get_category_link($cat->term_id) . '" title="' . sprintf(esc_html__('View all posts in %s', 'lsx'), $cat->name) . '" ' . '>' . $cat->name . '</a>'; |
|
147 | 147 | } |
148 | 148 | |
149 | - if ( ! empty( $cats ) ) { |
|
149 | + if ( ! empty($cats)) { |
|
150 | 150 | ?> |
151 | - <span class="post-meta-categories"><span><?php esc_html_e( 'Posted in:', 'lsx' ); ?></span> <?php echo wp_kses_post( implode( ', ', $cats ) ); ?></span> |
|
151 | + <span class="post-meta-categories"><span><?php esc_html_e('Posted in:', 'lsx'); ?></span> <?php echo wp_kses_post(implode(', ', $cats)); ?></span> |
|
152 | 152 | <?php |
153 | 153 | } |
154 | 154 | } |
155 | 155 | } |
156 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_category', 30 ); |
|
156 | +add_action('lsx_content_post_meta', 'lsx_post_meta_category', 30); |
|
157 | 157 | |
158 | 158 | /** |
159 | 159 | * Add customisable post meta: post tag(s) |
160 | 160 | */ |
161 | -if ( ! function_exists( 'lsx_post_tags' ) ) { |
|
161 | +if ( ! function_exists('lsx_post_tags')) { |
|
162 | 162 | function lsx_post_tags() { |
163 | - if ( has_tag() ) : |
|
163 | + if (has_tag()) : |
|
164 | 164 | ?> |
165 | 165 | <div class="post-tags"> |
166 | - <span><?php esc_html_e( 'Tagged as:', 'lsx' ); ?></span> <?php echo wp_kses_post( get_the_tag_list( '' ) ); ?> |
|
166 | + <span><?php esc_html_e('Tagged as:', 'lsx'); ?></span> <?php echo wp_kses_post(get_the_tag_list('')); ?> |
|
167 | 167 | </div> |
168 | 168 | <?php |
169 | 169 | endif; |
170 | 170 | } |
171 | 171 | } |
172 | -add_action( 'lsx_content_post_tags', 'lsx_post_tags', 10 ); |
|
172 | +add_action('lsx_content_post_tags', 'lsx_post_tags', 10); |
|
173 | 173 | |
174 | 174 | /** |
175 | 175 | * Add customisable post info: related posts |
176 | 176 | */ |
177 | 177 | function lsx_related_posts() { |
178 | - if ( is_singular( 'post' ) && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
178 | + if (is_singular('post') && class_exists('Jetpack_RelatedPosts')) { |
|
179 | 179 | ?> |
180 | 180 | <div class="row row-related-posts"> |
181 | 181 | <div class="col-md-12"> |
@@ -185,15 +185,15 @@ discard block |
||
185 | 185 | <?php |
186 | 186 | } |
187 | 187 | } |
188 | -add_action( 'lsx_entry_bottom', 'lsx_related_posts', 10 ); |
|
188 | +add_action('lsx_entry_bottom', 'lsx_related_posts', 10); |
|
189 | 189 | |
190 | 190 | /** |
191 | 191 | * Translate post format to Font Awesome class |
192 | 192 | */ |
193 | 193 | |
194 | -if ( ! function_exists( 'lsx_translate_format_to_fontawesome' ) ) { |
|
195 | - function lsx_translate_format_to_fontawesome( $format ) { |
|
196 | - switch ( $format ) { |
|
194 | +if ( ! function_exists('lsx_translate_format_to_fontawesome')) { |
|
195 | + function lsx_translate_format_to_fontawesome($format) { |
|
196 | + switch ($format) { |
|
197 | 197 | case 'image': |
198 | 198 | $format = 'camera'; |
199 | 199 | break; |
@@ -238,45 +238,45 @@ discard block |
||
238 | 238 | * to be added/modified where necessary. |
239 | 239 | */ |
240 | 240 | |
241 | -if ( ! function_exists( 'lsx_portfolio_meta' ) ) { |
|
241 | +if ( ! function_exists('lsx_portfolio_meta')) { |
|
242 | 242 | function lsx_portfolio_meta() { |
243 | 243 | ?> |
244 | 244 | <div id="portfolio-meta" class="portfolio-meta info-box-sticky info-box sticky-wrapper"> |
245 | 245 | <?php |
246 | - $client = get_post_meta(get_the_ID(),'lsx-client',true); |
|
247 | - if(false != $client){ ?> |
|
246 | + $client = get_post_meta(get_the_ID(), 'lsx-client', true); |
|
247 | + if (false != $client) { ?> |
|
248 | 248 | <div class="portfolio-client"> |
249 | - <span><span class="fa fa-user"></span><?php esc_html_e( 'Client','lsx' ); ?></span> |
|
250 | - <span><?php echo esc_html( $client ); ?></span> |
|
249 | + <span><span class="fa fa-user"></span><?php esc_html_e('Client', 'lsx'); ?></span> |
|
250 | + <span><?php echo esc_html($client); ?></span> |
|
251 | 251 | </div> |
252 | 252 | <?php } ?> |
253 | 253 | |
254 | 254 | <?php |
255 | - $portfolio_type = get_the_term_list( get_the_ID(), 'jetpack-portfolio-type', '', ', ', '' ); |
|
255 | + $portfolio_type = get_the_term_list(get_the_ID(), 'jetpack-portfolio-type', '', ', ', ''); |
|
256 | 256 | |
257 | - if($portfolio_type){ |
|
257 | + if ($portfolio_type) { |
|
258 | 258 | ?> |
259 | 259 | <div class="portfolio-industry"> |
260 | - <span><span class="fa fa-folder-open"></span><?php esc_html_e( 'Industry', 'lsx' ); ?></span> |
|
261 | - <?php echo wp_kses_post( $portfolio_type ); ?> |
|
260 | + <span><span class="fa fa-folder-open"></span><?php esc_html_e('Industry', 'lsx'); ?></span> |
|
261 | + <?php echo wp_kses_post($portfolio_type); ?> |
|
262 | 262 | </div> |
263 | 263 | <?php } ?> |
264 | 264 | |
265 | 265 | <?php |
266 | - $services = get_the_term_list( get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '' ); |
|
267 | - if(false != $services){ ?> |
|
266 | + $services = get_the_term_list(get_the_ID(), 'jetpack-portfolio-tag', '', ', ', ''); |
|
267 | + if (false != $services) { ?> |
|
268 | 268 | <div class="portfolio-services"> |
269 | - <span><span class="fa fa-cog"></span><?php esc_html_e( 'Services', 'lsx' ); ?></span> |
|
270 | - <?php echo wp_kses_post( $services ); ?> |
|
269 | + <span><span class="fa fa-cog"></span><?php esc_html_e('Services', 'lsx'); ?></span> |
|
270 | + <?php echo wp_kses_post($services); ?> |
|
271 | 271 | </div> |
272 | 272 | <?php } ?> |
273 | 273 | |
274 | 274 | <?php |
275 | - $website = esc_url( get_post_meta(get_the_ID(),'lsx-website',true) ); |
|
276 | - if(false != $website){ ?> |
|
275 | + $website = esc_url(get_post_meta(get_the_ID(), 'lsx-website', true)); |
|
276 | + if (false != $website) { ?> |
|
277 | 277 | <div class="portfolio-website"> |
278 | - <span><span class="fa fa-link"></span><?php esc_html_e( 'Website', 'lsx' ); ?></span> |
|
279 | - <a target="_blank" href="<?php echo esc_url( $website ); ?>"><?php echo esc_html( $website ) ?></a> |
|
278 | + <span><span class="fa fa-link"></span><?php esc_html_e('Website', 'lsx'); ?></span> |
|
279 | + <a target="_blank" href="<?php echo esc_url($website); ?>"><?php echo esc_html($website) ?></a> |
|
280 | 280 | </div> |
281 | 281 | <?php } ?> |
282 | 282 | |
@@ -290,29 +290,29 @@ discard block |
||
290 | 290 | * |
291 | 291 | */ |
292 | 292 | |
293 | -if ( ! function_exists( 'lsx_portfolio_gallery' ) ) { |
|
293 | +if ( ! function_exists('lsx_portfolio_gallery')) { |
|
294 | 294 | function lsx_portfolio_gallery() { |
295 | 295 | |
296 | - $media = get_attached_media( 'image' ); |
|
296 | + $media = get_attached_media('image'); |
|
297 | 297 | $media_array = array(); |
298 | 298 | $post_thumbnail_id = get_post_thumbnail_id(get_the_ID()); |
299 | 299 | |
300 | - if(!empty($media)){ |
|
301 | - foreach($media as $media_item){ |
|
302 | - if($post_thumbnail_id != $media_item->ID) { |
|
300 | + if ( ! empty($media)) { |
|
301 | + foreach ($media as $media_item) { |
|
302 | + if ($post_thumbnail_id != $media_item->ID) { |
|
303 | 303 | $media_array[] = $media_item->ID; |
304 | 304 | } |
305 | 305 | } |
306 | 306 | |
307 | - if(!empty($media_array)){ |
|
308 | - echo wp_kses_post( gallery_shortcode( array( 'size' => 'full', 'ids' => implode( ',', $media_array ) ) ) ); |
|
307 | + if ( ! empty($media_array)) { |
|
308 | + echo wp_kses_post(gallery_shortcode(array('size' => 'full', 'ids' => implode(',', $media_array)))); |
|
309 | 309 | } |
310 | 310 | } |
311 | 311 | |
312 | 312 | } |
313 | 313 | } |
314 | 314 | |
315 | -if ( ! function_exists( 'lsx_paging_nav' ) ) : |
|
315 | +if ( ! function_exists('lsx_paging_nav')) : |
|
316 | 316 | /** |
317 | 317 | * Display navigation to next/previous set of posts when applicable. |
318 | 318 | * |
@@ -320,33 +320,33 @@ discard block |
||
320 | 320 | */ |
321 | 321 | function lsx_paging_nav() { |
322 | 322 | // Don't print empty markup if there's only one page. |
323 | - if ( $GLOBALS['wp_query']->max_num_pages < 2 ) { |
|
323 | + if ($GLOBALS['wp_query']->max_num_pages < 2) { |
|
324 | 324 | return; |
325 | 325 | } |
326 | 326 | |
327 | - if(current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')){ |
|
327 | + if (current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')) { |
|
328 | 328 | return true; |
329 | - }elseif(function_exists('wp_pagenavi')){ |
|
329 | + }elseif (function_exists('wp_pagenavi')) { |
|
330 | 330 | wp_pagenavi(); |
331 | - }else{ |
|
331 | + } else { |
|
332 | 332 | |
333 | 333 | $labels = array( |
334 | - 'next' => '<span class="meta-nav">←</span> '.esc_html__( 'Older posts', 'lsx' ), |
|
335 | - 'previous' => esc_html__( 'Newer posts', 'lsx' ).' <span class="meta-nav">→</span>', |
|
336 | - 'title' => esc_html__( 'Posts navigation', 'lsx' ) |
|
334 | + 'next' => '<span class="meta-nav">←</span> ' . esc_html__('Older posts', 'lsx'), |
|
335 | + 'previous' => esc_html__('Newer posts', 'lsx') . ' <span class="meta-nav">→</span>', |
|
336 | + 'title' => esc_html__('Posts navigation', 'lsx') |
|
337 | 337 | ); |
338 | - $labels = apply_filters('lsx_post_navigation_labels',$labels); |
|
338 | + $labels = apply_filters('lsx_post_navigation_labels', $labels); |
|
339 | 339 | ?> |
340 | 340 | <nav class="navigation paging-navigation" role="navigation"> |
341 | 341 | <div class="lsx-breaker"></div> |
342 | - <h1 class="screen-reader-text"><?php echo esc_html( $labels['title'] ); ?></h1> |
|
342 | + <h1 class="screen-reader-text"><?php echo esc_html($labels['title']); ?></h1> |
|
343 | 343 | <div class="nav-links"> |
344 | - <?php if ( get_next_posts_link() ) : ?> |
|
345 | - <div class="nav-previous"><?php next_posts_link( $labels['next'] ); ?></div> |
|
344 | + <?php if (get_next_posts_link()) : ?> |
|
345 | + <div class="nav-previous"><?php next_posts_link($labels['next']); ?></div> |
|
346 | 346 | <?php endif; ?> |
347 | 347 | |
348 | - <?php if ( get_previous_posts_link() ) : ?> |
|
349 | - <div class="nav-next"><?php previous_posts_link( $labels['previous'] ); ?></div> |
|
348 | + <?php if (get_previous_posts_link()) : ?> |
|
349 | + <div class="nav-next"><?php previous_posts_link($labels['previous']); ?></div> |
|
350 | 350 | <?php endif; ?> |
351 | 351 | |
352 | 352 | <div class="clearfix"></div> |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | } |
358 | 358 | endif; |
359 | 359 | |
360 | -if ( ! function_exists( 'lsx_post_nav' ) ) : |
|
360 | +if ( ! function_exists('lsx_post_nav')) : |
|
361 | 361 | /** |
362 | 362 | * Display navigation to next/previous post when applicable. |
363 | 363 | * |
@@ -365,10 +365,10 @@ discard block |
||
365 | 365 | */ |
366 | 366 | function lsx_post_nav() { |
367 | 367 | // Don't print empty markup if there's nowhere to navigate. |
368 | - $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); |
|
369 | - $next = get_adjacent_post( false, '', false ); |
|
368 | + $previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true); |
|
369 | + $next = get_adjacent_post(false, '', false); |
|
370 | 370 | |
371 | - if ( ! $next && ! $previous ) { |
|
371 | + if ( ! $next && ! $previous) { |
|
372 | 372 | return; |
373 | 373 | } |
374 | 374 | ?> |
@@ -378,14 +378,14 @@ discard block |
||
378 | 378 | <div class="nav-links pager row"> |
379 | 379 | <div class="previous col-md-6"> |
380 | 380 | <?php |
381 | - $previous_post = get_previous_post_link( '%link', '<p class="nav-links-description">'._x( 'Previous Post', 'Previous post link', 'lsx' ).'</p><h3>%title</h3>' ); |
|
382 | - echo wp_kses_post( $previous_post ); |
|
381 | + $previous_post = get_previous_post_link('%link', '<p class="nav-links-description">' . _x('Previous Post', 'Previous post link', 'lsx') . '</p><h3>%title</h3>'); |
|
382 | + echo wp_kses_post($previous_post); |
|
383 | 383 | ?> |
384 | 384 | </div> |
385 | 385 | <div class="next col-md-6"> |
386 | 386 | <?php |
387 | - $next_post = get_next_post_link( '%link', '<p class="nav-links-description">'._x( 'Next Post', 'Next post link', 'lsx' ).'</p><h3>%title</h3>' ); |
|
388 | - echo wp_kses_post( $next_post ); |
|
387 | + $next_post = get_next_post_link('%link', '<p class="nav-links-description">' . _x('Next Post', 'Next post link', 'lsx') . '</p><h3>%title</h3>'); |
|
388 | + echo wp_kses_post($next_post); |
|
389 | 389 | ?> |
390 | 390 | </div> |
391 | 391 | </div><!-- .nav-links --> |
@@ -401,16 +401,16 @@ discard block |
||
401 | 401 | * @subpackage template-tags |
402 | 402 | * @category header |
403 | 403 | */ |
404 | -if(!function_exists('lsx_site_identity')){ |
|
405 | - function lsx_site_identity(){ |
|
404 | +if ( ! function_exists('lsx_site_identity')) { |
|
405 | + function lsx_site_identity() { |
|
406 | 406 | |
407 | - if ( function_exists('has_custom_logo') && has_custom_logo() ) { |
|
407 | + if (function_exists('has_custom_logo') && has_custom_logo()) { |
|
408 | 408 | the_custom_logo(); |
409 | - }elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { |
|
409 | + }elseif (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) { |
|
410 | 410 | jetpack_the_site_logo(); |
411 | - }else{ |
|
411 | + } else { |
|
412 | 412 | // shouldn't show both together.. its just strange |
413 | - if(true == get_theme_mod('site_logo_header_text',1)){ |
|
413 | + if (true == get_theme_mod('site_logo_header_text', 1)) { |
|
414 | 414 | lsx_site_title(); |
415 | 415 | } |
416 | 416 | } |
@@ -425,29 +425,29 @@ discard block |
||
425 | 425 | * @subpackage template-tags |
426 | 426 | * @category navigation |
427 | 427 | */ |
428 | -if(!function_exists('lsx_navbar_header')){ |
|
429 | - function lsx_navbar_header(){ ?> |
|
428 | +if ( ! function_exists('lsx_navbar_header')) { |
|
429 | + function lsx_navbar_header() { ?> |
|
430 | 430 | <div class="navbar-header" itemscope itemtype="http://schema.org/WebPage"> |
431 | 431 | |
432 | 432 | <?php |
433 | - $nav_menu = get_theme_mod('nav_menu_locations',false); |
|
433 | + $nav_menu = get_theme_mod('nav_menu_locations', false); |
|
434 | 434 | //print_r(get_nav_menu_locations()); |
435 | 435 | |
436 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
436 | + if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?> |
|
437 | 437 | <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".primary-navbar"> |
438 | - <span class="sr-only"><?php esc_html_e( 'Toggle navigation', 'lsx' ); ?></span> |
|
438 | + <span class="sr-only"><?php esc_html_e('Toggle navigation', 'lsx'); ?></span> |
|
439 | 439 | <span class="icon-bar"></span> |
440 | 440 | <span class="icon-bar"></span> |
441 | 441 | <span class="icon-bar"></span> |
442 | 442 | </button> |
443 | - <span class="mobile-menu-title"><?php esc_html_e( 'Menu', 'lsx' ); ?></span> |
|
443 | + <span class="mobile-menu-title"><?php esc_html_e('Menu', 'lsx'); ?></span> |
|
444 | 444 | <?php } ?> |
445 | 445 | <?php lsx_site_identity(); ?> |
446 | 446 | </div> |
447 | 447 | <?php } |
448 | 448 | } |
449 | 449 | //the if statement is for backwards compatability with previous versions of the theme. |
450 | -add_action('lsx_nav_before','lsx_navbar_header'); |
|
450 | +add_action('lsx_nav_before', 'lsx_navbar_header'); |
|
451 | 451 | |
452 | 452 | /** |
453 | 453 | * Outputs the Nav Menu |
@@ -456,16 +456,16 @@ discard block |
||
456 | 456 | * @subpackage template-tags |
457 | 457 | * @category navigation |
458 | 458 | */ |
459 | -if(!function_exists('lsx_nav_menu')){ |
|
460 | - function lsx_nav_menu(){ |
|
461 | - $nav_menu = get_theme_mod('nav_menu_locations',false); |
|
459 | +if ( ! function_exists('lsx_nav_menu')) { |
|
460 | + function lsx_nav_menu() { |
|
461 | + $nav_menu = get_theme_mod('nav_menu_locations', false); |
|
462 | 462 | |
463 | 463 | //print_r(get_nav_menu_locations()); |
464 | 464 | |
465 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
465 | + if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?> |
|
466 | 466 | <nav class="primary-navbar collapse navbar-collapse"> |
467 | 467 | <?php |
468 | - wp_nav_menu( array( |
|
468 | + wp_nav_menu(array( |
|
469 | 469 | 'theme_location' => 'primary', |
470 | 470 | 'menu' => $nav_menu['primary'], |
471 | 471 | 'depth' => 3, |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | * @subpackage template-tags |
487 | 487 | * @category sitemap |
488 | 488 | */ |
489 | -function lsx_sitemap_pages(){ |
|
489 | +function lsx_sitemap_pages() { |
|
490 | 490 | $page_args = array( |
491 | 491 | 'post_type' => 'page', |
492 | 492 | 'posts_per_page'=> 99, |
@@ -494,13 +494,13 @@ discard block |
||
494 | 494 | 'post_type' => 'page', |
495 | 495 | ); |
496 | 496 | $pages = new WP_Query($page_args); |
497 | - if($pages->have_posts()){ |
|
497 | + if ($pages->have_posts()) { |
|
498 | 498 | |
499 | - echo '<h2>' . esc_html__( 'Pages', 'lsx' ) . '</h2>'; |
|
499 | + echo '<h2>' . esc_html__('Pages', 'lsx') . '</h2>'; |
|
500 | 500 | |
501 | 501 | echo '<ul>'; |
502 | - while($pages->have_posts()){ $pages->the_post(); |
|
503 | - echo '<li class="page_item page-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>'; |
|
502 | + while ($pages->have_posts()) { $pages->the_post(); |
|
503 | + echo '<li class="page_item page-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>'; |
|
504 | 504 | } |
505 | 505 | echo '</ul>'; |
506 | 506 | |
@@ -515,13 +515,13 @@ discard block |
||
515 | 515 | * @subpackage template-tags |
516 | 516 | * @category sitemap |
517 | 517 | */ |
518 | -function lsx_sitemap_custom_post_type(){ |
|
518 | +function lsx_sitemap_custom_post_type() { |
|
519 | 519 | $args = array( |
520 | 520 | 'public' => true, |
521 | 521 | '_builtin' => false |
522 | 522 | ); |
523 | - $post_types = get_post_types($args , 'names'); |
|
524 | - foreach($post_types as $post_type){ |
|
523 | + $post_types = get_post_types($args, 'names'); |
|
524 | + foreach ($post_types as $post_type) { |
|
525 | 525 | |
526 | 526 | $post_type_args = array( |
527 | 527 | 'post_type' => 'page', |
@@ -532,19 +532,19 @@ discard block |
||
532 | 532 | $post_type_items = new WP_Query($post_type_args); |
533 | 533 | |
534 | 534 | $post_type_object = get_post_type_object($post_type); |
535 | - if(null != $post_type_object){ |
|
535 | + if (null != $post_type_object) { |
|
536 | 536 | $title = $post_type_object->labels->name; |
537 | - }else{ |
|
537 | + } else { |
|
538 | 538 | $title = ucwords($post_type); |
539 | 539 | } |
540 | 540 | |
541 | - if($post_type_items->have_posts()){ |
|
541 | + if ($post_type_items->have_posts()) { |
|
542 | 542 | |
543 | - echo '<h2>' . esc_html( $title ) . '</h2>'; |
|
543 | + echo '<h2>' . esc_html($title) . '</h2>'; |
|
544 | 544 | |
545 | 545 | echo '<ul>'; |
546 | - while($post_type_items->have_posts()){ $post_type_items->the_post(); |
|
547 | - echo '<li class="' . esc_attr( get_post_type() ) . '_item ' . esc_attr( get_post_type() ) . '-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>'; |
|
546 | + while ($post_type_items->have_posts()) { $post_type_items->the_post(); |
|
547 | + echo '<li class="' . esc_attr(get_post_type()) . '_item ' . esc_attr(get_post_type()) . '-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>'; |
|
548 | 548 | } |
549 | 549 | echo '</ul>'; |
550 | 550 | |
@@ -560,20 +560,20 @@ discard block |
||
560 | 560 | * @subpackage template-tags |
561 | 561 | * @category sitemap |
562 | 562 | */ |
563 | -function lsx_sitemap_taxonomy_clouds(){ |
|
563 | +function lsx_sitemap_taxonomy_clouds() { |
|
564 | 564 | |
565 | - $taxonomy_args = array( |
|
565 | + $taxonomy_args = array( |
|
566 | 566 | 'public' => true, |
567 | 567 | '_builtin' => false |
568 | 568 | ); |
569 | 569 | $taxonomies = get_taxonomies($taxonomy_args); |
570 | - if(!empty($taxonomies)){ |
|
571 | - foreach($taxonomies as $taxonomy_id => $taxonomy) { |
|
570 | + if ( ! empty($taxonomies)) { |
|
571 | + foreach ($taxonomies as $taxonomy_id => $taxonomy) { |
|
572 | 572 | |
573 | - $tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id,'echo'=>false)); |
|
574 | - if(null != $tag_cloud){ |
|
575 | - echo '<h2>' . esc_html( $taxonomy ) . '</h2>'; |
|
576 | - echo '<aside id="' . esc_attr( $taxonomy_id ) . '" class="widget widget_' . esc_attr( $taxonomy_id ) . '">' . esc_html( $tag_cloud ) . '</aside>'; |
|
573 | + $tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id, 'echo'=>false)); |
|
574 | + if (null != $tag_cloud) { |
|
575 | + echo '<h2>' . esc_html($taxonomy) . '</h2>'; |
|
576 | + echo '<aside id="' . esc_attr($taxonomy_id) . '" class="widget widget_' . esc_attr($taxonomy_id) . '">' . esc_html($tag_cloud) . '</aside>'; |
|
577 | 577 | } |
578 | 578 | } |
579 | 579 | } |
@@ -586,15 +586,15 @@ discard block |
||
586 | 586 | * @subpackage hooks |
587 | 587 | * @category forms |
588 | 588 | */ |
589 | -add_action( 'lsx_footer_before', 'lsx_footer_subscription_cta', 10 ); |
|
589 | +add_action('lsx_footer_before', 'lsx_footer_subscription_cta', 10); |
|
590 | 590 | function lsx_footer_subscription_cta() { |
591 | - if(!function_exists('lsx_is_form_enabled')){ return; } |
|
591 | + if ( ! function_exists('lsx_is_form_enabled')) { return; } |
|
592 | 592 | $subscribe_form_id = lsx_is_form_enabled('subscribe'); |
593 | - if(false == $subscribe_form_id) { return; } |
|
593 | + if (false == $subscribe_form_id) { return; } |
|
594 | 594 | |
595 | 595 | //add Caldera Forms Fields Scripts |
596 | - if( defined( 'CFCORE_VER' ) ){ |
|
597 | - wp_enqueue_script( 'cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER ); |
|
596 | + if (defined('CFCORE_VER')) { |
|
597 | + wp_enqueue_script('cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER); |
|
598 | 598 | } |
599 | 599 | |
600 | 600 | ?> |
@@ -602,8 +602,8 @@ discard block |
||
602 | 602 | <div class="container"> |
603 | 603 | <div class="row"> |
604 | 604 | <div class="col-md-12"> |
605 | - <h2><?php esc_html_e( 'Subscribe to Our Newsletter', 'lsx' ); ?></h2> |
|
606 | - <?php echo do_shortcode( '[caldera_form id="'.$subscribe_form_id.'"]' ); ?> |
|
605 | + <h2><?php esc_html_e('Subscribe to Our Newsletter', 'lsx'); ?></h2> |
|
606 | + <?php echo do_shortcode('[caldera_form id="' . $subscribe_form_id . '"]'); ?> |
|
607 | 607 | </div> |
608 | 608 | </div> |
609 | 609 | </div> |
@@ -619,13 +619,13 @@ discard block |
||
619 | 619 | * @category menu |
620 | 620 | */ |
621 | 621 | function lsx_add_top_menu() { |
622 | - if ( has_nav_menu( 'top-menu' ) || has_nav_menu(' top-menu-left' ) ) : ?> |
|
622 | + if (has_nav_menu('top-menu') || has_nav_menu(' top-menu-left')) : ?> |
|
623 | 623 | <div id="top-menu" class="<?php lsx_top_menu_classes(); ?>"> |
624 | 624 | <div class="container"> |
625 | - <?php if ( has_nav_menu( 'top-menu' ) ) : ?> |
|
625 | + <?php if (has_nav_menu('top-menu')) : ?> |
|
626 | 626 | <nav class="top-menu"> |
627 | 627 | <?php |
628 | - wp_nav_menu( array( |
|
628 | + wp_nav_menu(array( |
|
629 | 629 | 'theme_location' => 'top-menu', |
630 | 630 | 'walker' => new Lsx_Bootstrap_Navwalker()) |
631 | 631 | ); |
@@ -633,10 +633,10 @@ discard block |
||
633 | 633 | </nav> |
634 | 634 | <?php endif; ?> |
635 | 635 | |
636 | - <?php if ( has_nav_menu( 'top-menu-left' ) ) : ?> |
|
636 | + <?php if (has_nav_menu('top-menu-left')) : ?> |
|
637 | 637 | <nav class="top-menu pull-left"> |
638 | 638 | <?php |
639 | - wp_nav_menu( array( |
|
639 | + wp_nav_menu(array( |
|
640 | 640 | 'theme_location' => 'top-menu-left', |
641 | 641 | 'walker' => new Lsx_Bootstrap_Navwalker()) |
642 | 642 | ); |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | </div> |
648 | 648 | <?php endif; |
649 | 649 | } |
650 | -add_action( 'lsx_header_top', 'lsx_add_top_menu' ); |
|
650 | +add_action('lsx_header_top', 'lsx_add_top_menu'); |
|
651 | 651 | |
652 | 652 | /** |
653 | 653 | * Checks if a caldera form with your slug exists |
@@ -656,24 +656,24 @@ discard block |
||
656 | 656 | * @subpackage template-tag |
657 | 657 | * @category forms |
658 | 658 | */ |
659 | -if ( class_exists('Caldera_Forms') && !function_exists( 'lsx_is_form_enabled' ) ) { |
|
659 | +if (class_exists('Caldera_Forms') && ! function_exists('lsx_is_form_enabled')) { |
|
660 | 660 | function lsx_is_form_enabled($slug = false) { |
661 | - if(false == $slug){ return false; } |
|
661 | + if (false == $slug) { return false; } |
|
662 | 662 | |
663 | 663 | $match = false; |
664 | - $forms = get_option( '_caldera_forms' , false ); |
|
665 | - if(false !== $forms ) { |
|
666 | - foreach($forms as $form_id=>$form_maybe){ |
|
667 | - if( trim(strtolower($slug)) == strtolower($form_maybe['name']) ){ |
|
664 | + $forms = get_option('_caldera_forms', false); |
|
665 | + if (false !== $forms) { |
|
666 | + foreach ($forms as $form_id=>$form_maybe) { |
|
667 | + if (trim(strtolower($slug)) == strtolower($form_maybe['name'])) { |
|
668 | 668 | $match = $form_id; |
669 | 669 | break; |
670 | 670 | } |
671 | 671 | } |
672 | 672 | } |
673 | - if( false === $match ){ |
|
674 | - $is_form = Caldera_Forms::get_form( strtolower( $slug ) ); |
|
675 | - if( !empty( $is_form ) ){ |
|
676 | - return strtolower( $slug ); |
|
673 | + if (false === $match) { |
|
674 | + $is_form = Caldera_Forms::get_form(strtolower($slug)); |
|
675 | + if ( ! empty($is_form)) { |
|
676 | + return strtolower($slug); |
|
677 | 677 | } |
678 | 678 | } |
679 | 679 | |
@@ -689,10 +689,10 @@ discard block |
||
689 | 689 | * @category urls |
690 | 690 | */ |
691 | 691 | function lsx_get_my_url() { |
692 | - if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) |
|
692 | + if ( ! preg_match('/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches)) |
|
693 | 693 | return false; |
694 | 694 | |
695 | - return esc_url_raw( $matches[1] ); |
|
695 | + return esc_url_raw($matches[1]); |
|
696 | 696 | } |
697 | 697 | |
698 | 698 | /** |
@@ -702,19 +702,19 @@ discard block |
||
702 | 702 | * @subpackage extras |
703 | 703 | * @category urls |
704 | 704 | */ |
705 | -function lsx_get_template_part($slug,$part) { |
|
705 | +function lsx_get_template_part($slug, $part) { |
|
706 | 706 | $template = array(); |
707 | 707 | $part = (string) $part; |
708 | - if ( '' !== $part ){ |
|
708 | + if ('' !== $part) { |
|
709 | 709 | $template = "{$slug}-{$part}.php"; |
710 | - }else{ |
|
710 | + } else { |
|
711 | 711 | $template = "{$slug}.php"; |
712 | 712 | } |
713 | - $file_path = apply_filters('lsx_content_path',false,$slug,$part); |
|
713 | + $file_path = apply_filters('lsx_content_path', false, $slug, $part); |
|
714 | 714 | |
715 | - if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) { |
|
716 | - load_template( $file_path.$template, false ); |
|
717 | - }else{ |
|
718 | - get_template_part($slug,$part); |
|
715 | + if (false !== $file_path && '' == locate_template(array($template)) && file_exists($file_path . $template)) { |
|
716 | + load_template($file_path . $template, false); |
|
717 | + } else { |
|
718 | + get_template_part($slug, $part); |
|
719 | 719 | } |
720 | 720 | } |
721 | 721 | \ No newline at end of file |