@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -1,12 +1,12 @@ 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 | * Customizer Header Fixed Class |
6 | 6 | * |
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
10 | 10 | return; |
11 | 11 | } |
12 | 12 | class LSX_Customize_Header_Fixed_Control extends WP_Customize_Control { |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param string $id |
39 | 39 | * @param array $args |
40 | 40 | */ |
41 | - public function __construct( $manager, $id, $args = array() ) { |
|
42 | - parent::__construct( $manager, $id, $args ); |
|
43 | - if( !empty( $args['choices'] ) ){ |
|
41 | + public function __construct($manager, $id, $args = array()) { |
|
42 | + parent::__construct($manager, $id, $args); |
|
43 | + if ( ! empty($args['choices'])) { |
|
44 | 44 | $this->layouts = $args['choices']; |
45 | 45 | } |
46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function enqueue() { |
54 | 54 | // |
55 | - wp_enqueue_script( 'lsx-header-fixed-control', get_template_directory_uri() .'/js/customizer-header-fixed.js', array('jquery'), LSX_VERSION, true ); |
|
55 | + wp_enqueue_script('lsx-header-fixed-control', get_template_directory_uri() . '/js/customizer-header-fixed.js', array('jquery'), LSX_VERSION, true); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -62,21 +62,21 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function render_content() { |
64 | 64 | |
65 | - $post_id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); |
|
65 | + $post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id)); |
|
66 | 66 | $class = 'customize-control customize-control-' . $this->type; |
67 | 67 | $value = $this->value(); |
68 | 68 | |
69 | 69 | ?> |
70 | 70 | <label> |
71 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
72 | - <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
|
71 | + <?php if ( ! empty($this->label)) { ?> |
|
72 | + <span class="customize-control-title"><?php echo esc_html($this->label); ?></span> |
|
73 | 73 | <?php } |
74 | - if ( ! empty( $this->description ) ) { ?> |
|
75 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> |
|
74 | + if ( ! empty($this->description)) { ?> |
|
75 | + <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> |
|
76 | 76 | <?php } ?> |
77 | 77 | <div class="header-fixed"> |
78 | 78 | <label> |
79 | - <input <?php $this->link(); ?> type="checkbox" id="<?php echo esc_attr( $post_id ); ?>" class="header-fixed <?php echo esc_attr( $class ); ?>" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> Uncheck for standard header |
|
79 | + <input <?php $this->link(); ?> type="checkbox" id="<?php echo esc_attr($post_id); ?>" class="header-fixed <?php echo esc_attr($class); ?>" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> Uncheck for standard header |
|
80 | 80 | </label> |
81 | 81 | </div> |
82 | 82 | </label> |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Constructor |
15 | - **/ |
|
15 | + **/ |
|
16 | 16 | public function __construct($title, $location, $cssDeclaration, $cssClass) |
17 | 17 | { |
18 | 18 | $this->title = $title; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * Getters |
26 | 26 | * taken from: http://stackoverflow.com/questions/4478661/getter-and-setter |
27 | - **/ |
|
27 | + **/ |
|
28 | 28 | public function __get($property) |
29 | 29 | { |
30 | 30 | if (property_exists($this, $property)) { |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -1,42 +1,42 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * LSX_Customize_Font_Control Class |
6 | 6 | **/ |
7 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
7 | +if ( ! class_exists('WP_Customize_Control')) { |
|
8 | 8 | return; |
9 | 9 | } |
10 | -class LSX_Customize_Font_Control extends WP_Customize_Control{ |
|
10 | +class LSX_Customize_Font_Control extends WP_Customize_Control { |
|
11 | 11 | public $fonts; |
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Enqueue the styles and scripts |
15 | 15 | **/ |
16 | - public function enqueue(){ |
|
16 | + public function enqueue() { |
|
17 | 17 | // styles |
18 | - wp_enqueue_style( 'lsx-font-picker-custom-control', get_template_directory_uri() .'/css/customizer-font.css', array(), LSX_VERSION ); |
|
18 | + wp_enqueue_style('lsx-font-picker-custom-control', get_template_directory_uri() . '/css/customizer-font.css', array(), LSX_VERSION); |
|
19 | 19 | |
20 | 20 | // scripts |
21 | - wp_enqueue_script( 'lsx-font-picker-custom-control', get_template_directory_uri() .'/js/customizer-font.js', array(), LSX_VERSION ); |
|
21 | + wp_enqueue_script('lsx-font-picker-custom-control', get_template_directory_uri() . '/js/customizer-font.js', array(), LSX_VERSION); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Render the content on the theme customizer page |
26 | 26 | **/ |
27 | - public function render_content(){ |
|
28 | - if ( empty( $this->choices ) ){ |
|
27 | + public function render_content() { |
|
28 | + if (empty($this->choices)) { |
|
29 | 29 | // if there are no choices then don't print anything |
30 | 30 | return; |
31 | 31 | } |
32 | 32 | $fonts = array(); |
33 | - foreach( $this->choices as $slug=>$font ){ |
|
33 | + foreach ($this->choices as $slug=>$font) { |
|
34 | 34 | $fonts[] = $font['header']; |
35 | 35 | $fonts[] = $font['body']; |
36 | 36 | $this->choices[$slug] = $font; |
37 | 37 | } |
38 | 38 | |
39 | - $this->fonts = new LSX_Google_Font_Collection( $fonts ); |
|
39 | + $this->fonts = new LSX_Google_Font_Collection($fonts); |
|
40 | 40 | |
41 | 41 | $fonts = $this->fonts->get_font_family_name_array(); |
42 | 42 | //print links to css files |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | <div class="fontPickerCustomControl"> |
52 | 52 | <select <?php $this->link(); ?>> |
53 | 53 | <?php |
54 | - foreach ( $this->choices as $value => $conf ){ |
|
55 | - echo '<option value="' . esc_attr( $value ) . '">' . esc_html( $value ) . '</option>'; |
|
54 | + foreach ($this->choices as $value => $conf) { |
|
55 | + echo '<option value="' . esc_attr($value) . '">' . esc_html($value) . '</option>'; |
|
56 | 56 | } |
57 | 57 | ?> |
58 | 58 | </select> |
@@ -60,16 +60,16 @@ discard block |
||
60 | 60 | <ul> |
61 | 61 | <?php |
62 | 62 | //$cssClassArray = $this->fonts->get_css_class_array(); |
63 | - foreach ($this->choices as $key => $font){ |
|
63 | + foreach ($this->choices as $key => $font) { |
|
64 | 64 | $class = null; |
65 | - if( $key == $set_value ){ |
|
65 | + if ($key == $set_value) { |
|
66 | 66 | $class = ' selected'; |
67 | 67 | } |
68 | 68 | |
69 | 69 | ?> |
70 | - <li class="font-choice <?php echo esc_attr( $class ); ?>"> |
|
71 | - <div class="<?php echo esc_attr( $font['header']['cssClass'] ); ?>"><?php echo esc_html( $font['header']['title'] ); ?></div> |
|
72 | - <small class="<?php echo esc_attr( $font['body']['cssClass'] ); ?>"><?php echo esc_html( $font['body']['title'] ); ?></small> |
|
70 | + <li class="font-choice <?php echo esc_attr($class); ?>"> |
|
71 | + <div class="<?php echo esc_attr($font['header']['cssClass']); ?>"><?php echo esc_html($font['header']['title']); ?></div> |
|
72 | + <small class="<?php echo esc_attr($font['body']['cssClass']); ?>"><?php echo esc_html($font['body']['title']); ?></small> |
|
73 | 73 | </li> |
74 | 74 | <?php |
75 | 75 | } |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -1,12 +1,12 @@ 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 | * Customizer Header Swatch Control Class |
6 | 6 | * |
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
10 | 10 | return; |
11 | 11 | } |
12 | 12 | class LSX_Customize_Header_Layout_Control extends WP_Customize_Control { |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param string $id |
39 | 39 | * @param array $args |
40 | 40 | */ |
41 | - public function __construct( $manager, $id, $args = array() ) { |
|
42 | - parent::__construct( $manager, $id, $args ); |
|
43 | - if( !empty( $args['choices'] ) ){ |
|
41 | + public function __construct($manager, $id, $args = array()) { |
|
42 | + parent::__construct($manager, $id, $args); |
|
43 | + if ( ! empty($args['choices'])) { |
|
44 | 44 | $this->layouts = $args['choices']; |
45 | 45 | } |
46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function enqueue() { |
54 | 54 | // |
55 | - wp_enqueue_script( 'lsx-header-layout-control', get_template_directory_uri() .'/js/customizer-header-layout.js', array('jquery'), LSX_VERSION, true ); |
|
55 | + wp_enqueue_script('lsx-header-layout-control', get_template_directory_uri() . '/js/customizer-header-layout.js', array('jquery'), LSX_VERSION, true); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -62,30 +62,30 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function render_content() { |
64 | 64 | |
65 | - $post_id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); |
|
65 | + $post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id)); |
|
66 | 66 | $class = 'customize-control customize-control-' . $this->type; |
67 | 67 | $value = $this->value(); |
68 | 68 | |
69 | 69 | ?> |
70 | 70 | <label> |
71 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
72 | - <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
|
71 | + <?php if ( ! empty($this->label)) { ?> |
|
72 | + <span class="customize-control-title"><?php echo esc_html($this->label); ?></span> |
|
73 | 73 | <?php } |
74 | - if ( ! empty( $this->description ) ) { ?> |
|
75 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> |
|
74 | + if ( ! empty($this->description)) { ?> |
|
75 | + <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> |
|
76 | 76 | <?php } ?> |
77 | 77 | <div class="header-layouts-selector"> |
78 | 78 | <?php |
79 | - foreach( $this->layouts as $layout ){ |
|
79 | + foreach ($this->layouts as $layout) { |
|
80 | 80 | $sel = 'border: 1px solid transparent;'; |
81 | - if( $value == $layout ){ |
|
81 | + if ($value == $layout) { |
|
82 | 82 | $sel = 'border: 1px solid rgb(43, 166, 203);'; |
83 | 83 | } |
84 | - echo '<img class="header-layout-button" style="padding:2px;'. esc_attr( $sel ) .'" src="' . esc_attr( get_template_directory_uri() ) .'/img/header-' . esc_attr( $layout ) . '.png" data-option="' . esc_attr( $layout ) . '">'; |
|
84 | + echo '<img class="header-layout-button" style="padding:2px;' . esc_attr($sel) . '" src="' . esc_attr(get_template_directory_uri()) . '/img/header-' . esc_attr($layout) . '.png" data-option="' . esc_attr($layout) . '">'; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | ?> |
88 | - <input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr( $class ); ?>" id="<?php echo esc_attr( $post_id ); ?>" type="hidden" value="<?php echo esc_attr( $value ); ?>" <?php $this->input_attrs(); ?>> |
|
88 | + <input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr($class); ?>" id="<?php echo esc_attr($post_id); ?>" type="hidden" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> |
|
89 | 89 | </div> |
90 | 90 | </label> |
91 | 91 | <?php |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -45,15 +45,15 @@ |
||
45 | 45 | add_action( 'widgets_init', 'lsx_widget_area_init' ); |
46 | 46 | |
47 | 47 | function lsx_sidebar_footer_params( $params ) { |
48 | - $sidebar_id = $params[0]['id']; |
|
48 | + $sidebar_id = $params[0]['id']; |
|
49 | 49 | |
50 | - if ( 'sidebar-footer' == $sidebar_id ) { |
|
51 | - $total_widgets = wp_get_sidebars_widgets(); |
|
52 | - $sidebar_widgets = count($total_widgets[$sidebar_id]); |
|
50 | + if ( 'sidebar-footer' == $sidebar_id ) { |
|
51 | + $total_widgets = wp_get_sidebars_widgets(); |
|
52 | + $sidebar_widgets = count($total_widgets[$sidebar_id]); |
|
53 | 53 | |
54 | - $params[0]['before_widget'] = str_replace('class="styler', 'class="col-sm-' . floor(12 / $sidebar_widgets), $params[0]['before_widget']); |
|
55 | - } |
|
54 | + $params[0]['before_widget'] = str_replace('class="styler', 'class="col-sm-' . floor(12 / $sidebar_widgets), $params[0]['before_widget']); |
|
55 | + } |
|
56 | 56 | |
57 | - return $params; |
|
57 | + return $params; |
|
58 | 58 | } |
59 | 59 | add_filter( 'dynamic_sidebar_params', 'lsx_sidebar_footer_params' ); |
60 | 60 | \ No newline at end of file |
@@ -1,53 +1,53 @@ 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 | * Register widgetized area and update sidebar with default widgets. |
6 | 6 | */ |
7 | 7 | function lsx_widget_area_init() { |
8 | 8 | |
9 | - register_sidebar( array( |
|
10 | - 'name' => esc_html__( 'Home', 'lsx' ), |
|
9 | + register_sidebar(array( |
|
10 | + 'name' => esc_html__('Home', 'lsx'), |
|
11 | 11 | 'id' => 'sidebar-home', |
12 | 12 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
13 | 13 | 'after_widget' => '</aside>', |
14 | 14 | 'before_title' => '<h3 class="widget-title">', |
15 | 15 | 'after_title' => '</h3>', |
16 | - ) ); |
|
16 | + )); |
|
17 | 17 | |
18 | - register_sidebar( array( |
|
19 | - 'name' => esc_html__( 'Sidebar', 'lsx' ), |
|
18 | + register_sidebar(array( |
|
19 | + 'name' => esc_html__('Sidebar', 'lsx'), |
|
20 | 20 | 'id' => 'sidebar-1', |
21 | 21 | 'before_widget' => '<aside id="%1$s" class="widget %2$s">', |
22 | 22 | 'after_widget' => '</aside>', |
23 | 23 | 'before_title' => '<h3 class="widget-title">', |
24 | 24 | 'after_title' => '</h3>', |
25 | - ) ); |
|
25 | + )); |
|
26 | 26 | |
27 | - register_sidebar( array( |
|
28 | - 'name' => esc_html__( 'Footer', 'lsx' ), |
|
27 | + register_sidebar(array( |
|
28 | + 'name' => esc_html__('Footer', 'lsx'), |
|
29 | 29 | 'id' => 'sidebar-footer', |
30 | 30 | 'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">', |
31 | 31 | 'after_widget' => '</aside></div>', |
32 | 32 | 'before_title' => '<h3 class="widget-title">', |
33 | 33 | 'after_title' => '</h3>', |
34 | - ) ); |
|
34 | + )); |
|
35 | 35 | |
36 | - register_sidebar( array( |
|
37 | - 'name' => esc_html__( 'Footer Call to Action', 'lsx' ), |
|
36 | + register_sidebar(array( |
|
37 | + 'name' => esc_html__('Footer Call to Action', 'lsx'), |
|
38 | 38 | 'id' => 'sidebar-footer-cta', |
39 | 39 | 'before_widget' => '<div class="styler"><aside id="%1$s" class="widget %2$s">', |
40 | 40 | 'after_widget' => '</aside></div>', |
41 | 41 | 'before_title' => '<h3 class="widget-title">', |
42 | 42 | 'after_title' => '</h3>', |
43 | - ) ); |
|
43 | + )); |
|
44 | 44 | } |
45 | -add_action( 'widgets_init', 'lsx_widget_area_init' ); |
|
45 | +add_action('widgets_init', 'lsx_widget_area_init'); |
|
46 | 46 | |
47 | -function lsx_sidebar_footer_params( $params ) { |
|
47 | +function lsx_sidebar_footer_params($params) { |
|
48 | 48 | $sidebar_id = $params[0]['id']; |
49 | 49 | |
50 | - if ( 'sidebar-footer' == $sidebar_id ) { |
|
50 | + if ('sidebar-footer' == $sidebar_id) { |
|
51 | 51 | $total_widgets = wp_get_sidebars_widgets(); |
52 | 52 | $sidebar_widgets = count($total_widgets[$sidebar_id]); |
53 | 53 | |
@@ -56,4 +56,4 @@ discard block |
||
56 | 56 | |
57 | 57 | return $params; |
58 | 58 | } |
59 | -add_filter( 'dynamic_sidebar_params', 'lsx_sidebar_footer_params' ); |
|
60 | 59 | \ No newline at end of file |
60 | +add_filter('dynamic_sidebar_params', 'lsx_sidebar_footer_params'); |
|
61 | 61 | \ No newline at end of file |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -1,5 +1,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 | * Cleaner walker for wp_nav_menu() |
@@ -25,17 +25,17 @@ discard block |
||
25 | 25 | $item_html = ''; |
26 | 26 | |
27 | 27 | //If there is no menu set, dont use the pages, the objects are not the same as whats supposed to be used. |
28 | - if(isset($item->title)){ |
|
28 | + if (isset($item->title)) { |
|
29 | 29 | |
30 | 30 | parent::start_el($item_html, $item, $depth, $args); |
31 | 31 | |
32 | - if ( $item->is_dropdown && ( 0 === $depth ) ) { |
|
32 | + if ($item->is_dropdown && (0 === $depth)) { |
|
33 | 33 | $item_html = str_replace('<a', '<a class="dropdown-toggle" data-target="#"', $item_html); |
34 | 34 | $item_html = str_replace('</a>', ' <b class="caret"></b></a>', $item_html); |
35 | - } elseif ( stristr( $item_html, 'li class="divider"' ) ) { |
|
35 | + } elseif (stristr($item_html, 'li class="divider"')) { |
|
36 | 36 | $item_html = preg_replace('/<a[^>]*>.*?<\/a>/iU', '', $item_html); |
37 | - } elseif ( stristr( $item_html, 'li class="dropdown-header"' ) ) { |
|
38 | - $item_html = preg_replace( '/<a[^>]*>(.*)<\/a>/iU', '$1', $item_html ); |
|
37 | + } elseif (stristr($item_html, 'li class="dropdown-header"')) { |
|
38 | + $item_html = preg_replace('/<a[^>]*>(.*)<\/a>/iU', '$1', $item_html); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $item_html = apply_filters('lsx_wp_nav_menu_item', $item_html); |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output) { |
48 | - $element->is_dropdown = ( ( ! empty( $children_elements[$element->ID] ) && ( ( $depth + 1 ) < $max_depth || ( 0 === $max_depth ) ) ) ); |
|
48 | + $element->is_dropdown = (( ! empty($children_elements[$element->ID]) && (($depth + 1) < $max_depth || (0 === $max_depth)))); |
|
49 | 49 | |
50 | - if ( $element->is_dropdown ) { |
|
51 | - if ( $depth > 0 ) { |
|
50 | + if ($element->is_dropdown) { |
|
51 | + if ($depth > 0) { |
|
52 | 52 | $element->classes[] = 'dropdown-submenu'; |
53 | 53 | } else { |
54 | 54 | $element->classes[] = 'dropdown'; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $classes = preg_replace('/(current(-menu-|[-_]page[-_])(item|parent|ancestor))/', 'active', $classes); |
69 | 69 | $classes = preg_replace('/^((menu|page)[-_\w+]+)+/', '', $classes); |
70 | 70 | |
71 | - $classes[] = 'menu-'.$slug; |
|
71 | + $classes[] = 'menu-' . $slug; |
|
72 | 72 | |
73 | 73 | $classes = array_unique($classes); |
74 | 74 | |
@@ -86,15 +86,15 @@ discard block |
||
86 | 86 | function lsx_nav_menu_args($args = '') { |
87 | 87 | $roots_nav_menu_args['container'] = false; |
88 | 88 | |
89 | - if (!$args['items_wrap']) { |
|
89 | + if ( ! $args['items_wrap']) { |
|
90 | 90 | $roots_nav_menu_args['items_wrap'] = '<ul class="%2$s">%3$s</ul>'; |
91 | 91 | } |
92 | 92 | |
93 | - if (current_theme_supports('bootstrap-top-navbar') && !$args['depth']) { |
|
93 | + if (current_theme_supports('bootstrap-top-navbar') && ! $args['depth']) { |
|
94 | 94 | $roots_nav_menu_args['depth'] = 2; |
95 | 95 | } |
96 | 96 | |
97 | - if (!$args['walker']) { |
|
97 | + if ( ! $args['walker']) { |
|
98 | 98 | $roots_nav_menu_args['walker'] = new LSX_Nav_Walker(); |
99 | 99 | } |
100 | 100 |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + return; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Customize Swatch Control Class |
@@ -1,5 +1,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); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | <?php lsx_content_wrap_before(); ?> |
16 | 16 | |
17 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
17 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
18 | 18 | |
19 | 19 | <?php lsx_content_before(); ?> |
20 | 20 | |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | |
23 | 23 | <?php lsx_content_top(); ?> |
24 | 24 | |
25 | - <?php while ( have_posts() ) : the_post(); ?> |
|
25 | + <?php while (have_posts()) : the_post(); ?> |
|
26 | 26 | |
27 | - <?php get_template_part( 'content', get_post_type() ); ?> |
|
27 | + <?php get_template_part('content', get_post_type()); ?> |
|
28 | 28 | |
29 | 29 | <?php endwhile; // end of the loop. ?> |
30 | 30 |
@@ -10,23 +10,23 @@ discard block |
||
10 | 10 | |
11 | 11 | <?php lsx_content_top(); ?> |
12 | 12 | |
13 | - <?php if(is_tax()){ ?> |
|
13 | + <?php if (is_tax()) { ?> |
|
14 | 14 | <div class="entry-content"> |
15 | 15 | <?php the_archive_description(); ?> |
16 | 16 | </div> |
17 | 17 | <?php } ?> |
18 | 18 | |
19 | 19 | <?php |
20 | - if ( post_type_exists( 'jetpack-portfolio' ) && have_posts() ) : |
|
20 | + if (post_type_exists('jetpack-portfolio') && have_posts()) : |
|
21 | 21 | ?> |
22 | 22 | |
23 | - <?php if(!is_tax()){ lsx_portfolio_sorter(); } ?> |
|
23 | + <?php if ( ! is_tax()) { lsx_portfolio_sorter(); } ?> |
|
24 | 24 | |
25 | 25 | <div class="filter-items-wrapper lsx-portfolio-wrapper"> |
26 | 26 | <div id="portfolio-infinite-scroll-wrapper" class="filter-items-container lsx-portfolio masonry"> |
27 | - <?php while ( have_posts() ) : the_post(); ?> |
|
27 | + <?php while (have_posts()) : the_post(); ?> |
|
28 | 28 | |
29 | - <?php get_template_part( 'content', 'portfolio' ); ?> |
|
29 | + <?php get_template_part('content', 'portfolio'); ?> |
|
30 | 30 | |
31 | 31 | <?php endwhile; ?> |
32 | 32 | </div> |
@@ -40,17 +40,17 @@ discard block |
||
40 | 40 | |
41 | 41 | <section class="no-results not-found"> |
42 | 42 | <header class="page-header"> |
43 | - <h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'lsx' ); ?></h1> |
|
43 | + <h1 class="page-title"><?php esc_html_e('Nothing Found', 'lsx'); ?></h1> |
|
44 | 44 | </header><!-- .page-header --> |
45 | 45 | |
46 | 46 | <div class="page-content"> |
47 | - <?php if ( current_user_can( 'publish_posts' ) ) : ?> |
|
47 | + <?php if (current_user_can('publish_posts')) : ?> |
|
48 | 48 | |
49 | - <p><?php esc_html_e( 'Ready to publish your first project?', 'lsx' ); ?> <a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=jetpack-portfolio' ) ) ?>"><?php esc_html_e( 'Get started here', 'lsx' ); ?></a></p> |
|
49 | + <p><?php esc_html_e('Ready to publish your first project?', 'lsx'); ?> <a href="<?php echo esc_url(admin_url('post-new.php?post_type=jetpack-portfolio')) ?>"><?php esc_html_e('Get started here', 'lsx'); ?></a></p> |
|
50 | 50 | |
51 | 51 | <?php else : ?> |
52 | 52 | |
53 | - <p><?php esc_html_e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'lsx' ); ?></p> |
|
53 | + <p><?php esc_html_e('It seems we can’t find what you’re looking for. Perhaps searching can help.', 'lsx'); ?></p> |
|
54 | 54 | <?php get_search_form(); ?> |
55 | 55 | |
56 | 56 | <?php endif; ?> |
@@ -36,11 +36,14 @@ discard block |
||
36 | 36 | |
37 | 37 | <?php lsx_paging_nav(); ?> |
38 | 38 | |
39 | - <?php else : ?> |
|
39 | + <?php else { |
|
40 | + : ?> |
|
40 | 41 | |
41 | 42 | <section class="no-results not-found"> |
42 | 43 | <header class="page-header"> |
43 | - <h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'lsx' ); ?></h1> |
|
44 | + <h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'lsx' ); |
|
45 | +} |
|
46 | +?></h1> |
|
44 | 47 | </header><!-- .page-header --> |
45 | 48 | |
46 | 49 | <div class="page-content"> |
@@ -48,9 +51,12 @@ discard block |
||
48 | 51 | |
49 | 52 | <p><?php esc_html_e( 'Ready to publish your first project?', 'lsx' ); ?> <a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=jetpack-portfolio' ) ) ?>"><?php esc_html_e( 'Get started here', 'lsx' ); ?></a></p> |
50 | 53 | |
51 | - <?php else : ?> |
|
54 | + <?php else { |
|
55 | + : ?> |
|
52 | 56 | |
53 | - <p><?php esc_html_e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'lsx' ); ?></p> |
|
57 | + <p><?php esc_html_e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'lsx' ); |
|
58 | +} |
|
59 | +?></p> |
|
54 | 60 | <?php get_search_form(); ?> |
55 | 61 | |
56 | 62 | <?php endif; ?> |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | |
6 | 6 | <?php lsx_content_wrap_before(); ?> |
7 | 7 | |
8 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
8 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
9 | 9 | |
10 | 10 | <?php lsx_content_before(); ?> |
11 | 11 | |
@@ -13,7 +13,7 @@ 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 | 18 | <?php lsx_entry_before(); ?> |
19 | 19 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | <?php lsx_sitemap_custom_post_type(); ?> |
29 | 29 | |
30 | 30 | </div><!-- .entry-content --> |
31 | - <?php edit_post_link( __( 'Edit', 'lsx' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?> |
|
31 | + <?php edit_post_link(__('Edit', 'lsx'), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>'); ?> |
|
32 | 32 | |
33 | 33 | <?php lsx_entry_bottom(); ?> |
34 | 34 |