@@ -5,6 +5,7 @@ |
||
| 5 | 5 | * Layout hooks |
| 6 | 6 | * |
| 7 | 7 | * @package lsx |
| 8 | + * @param string $class |
|
| 8 | 9 | */ |
| 9 | 10 | |
| 10 | 11 | function lsx_layout_selector( $class, $area = 'site' ) { |
@@ -1,5 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Layout hooks |
@@ -62,7 +65,7 @@ discard block |
||
| 62 | 65 | $show_on_front = get_option('show_on_front'); |
| 63 | 66 | if('page' == $show_on_front){ |
| 64 | 67 | return lsx_layout_selector( 'main', 'home' ); |
| 65 | - }else{ |
|
| 68 | + } else{ |
|
| 66 | 69 | return lsx_layout_selector( 'main', 'site' ); |
| 67 | 70 | } |
| 68 | 71 | |
@@ -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 | * Layout hooks |
@@ -7,15 +7,15 @@ discard block |
||
| 7 | 7 | * @package lsx |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -function lsx_layout_selector( $class, $area = 'site' ) { |
|
| 10 | +function lsx_layout_selector($class, $area = 'site') { |
|
| 11 | 11 | |
| 12 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 13 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
| 12 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 13 | + $layout = apply_filters('lsx_layout', $layout); |
|
| 14 | 14 | |
| 15 | 15 | $default_size = 'sm'; |
| 16 | - $size = apply_filters( 'lsx_bootstrap_column_size', $default_size ); |
|
| 16 | + $size = apply_filters('lsx_bootstrap_column_size', $default_size); |
|
| 17 | 17 | |
| 18 | - switch ( $layout ) { |
|
| 18 | + switch ($layout) { |
|
| 19 | 19 | case '1c': |
| 20 | 20 | $main_class = 'col-' . $size . '-12'; |
| 21 | 21 | $sidebar_class = 'col-' . $size . '-12'; |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | break; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - if ( 'main' == $class ) { |
|
| 37 | + if ('main' == $class) { |
|
| 38 | 38 | return $main_class; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - if ( 'sidebar' == $class ) { |
|
| 41 | + if ('sidebar' == $class) { |
|
| 42 | 42 | return $sidebar_class; |
| 43 | 43 | } |
| 44 | 44 | } |
@@ -47,11 +47,11 @@ discard block |
||
| 47 | 47 | * .main classes |
| 48 | 48 | */ |
| 49 | 49 | function lsx_main_class() { |
| 50 | - return lsx_layout_selector( 'main' ); |
|
| 50 | + return lsx_layout_selector('main'); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | function lsx_home_main_class() { |
| 54 | - return lsx_layout_selector( 'main', 'home' ); |
|
| 54 | + return lsx_layout_selector('main', 'home'); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -60,10 +60,10 @@ discard block |
||
| 60 | 60 | function lsx_index_main_class() { |
| 61 | 61 | |
| 62 | 62 | $show_on_front = get_option('show_on_front'); |
| 63 | - if('page' == $show_on_front){ |
|
| 64 | - return lsx_layout_selector( 'main', 'home' ); |
|
| 65 | - }else{ |
|
| 66 | - return lsx_layout_selector( 'main', 'site' ); |
|
| 63 | + if ('page' == $show_on_front) { |
|
| 64 | + return lsx_layout_selector('main', 'home'); |
|
| 65 | + } else { |
|
| 66 | + return lsx_layout_selector('main', 'site'); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | } |
@@ -72,11 +72,11 @@ discard block |
||
| 72 | 72 | * .sidebar classes |
| 73 | 73 | */ |
| 74 | 74 | function lsx_sidebar_class() { |
| 75 | - return lsx_layout_selector( 'sidebar' ); |
|
| 75 | + return lsx_layout_selector('sidebar'); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | function lsx_home_sidebar_class() { |
| 79 | - return lsx_layout_selector( 'sidebar', 'home' ); |
|
| 79 | + return lsx_layout_selector('sidebar', 'home'); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -91,15 +91,15 @@ discard block |
||
| 91 | 91 | $classes = 'banner navbar navbar-default'; |
| 92 | 92 | |
| 93 | 93 | //Fixed header |
| 94 | - $fixed_header = get_theme_mod('lsx_header_fixed',false); |
|
| 95 | - if(false != $fixed_header){ |
|
| 94 | + $fixed_header = get_theme_mod('lsx_header_fixed', false); |
|
| 95 | + if (false != $fixed_header) { |
|
| 96 | 96 | $classes .= ' navbar-static-top'; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if(false != $additional){ |
|
| 100 | - $classes .= ' '.$additional; |
|
| 99 | + if (false != $additional) { |
|
| 100 | + $classes .= ' ' . $additional; |
|
| 101 | 101 | } |
| 102 | - echo esc_attr( $classes ); |
|
| 102 | + echo esc_attr($classes); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -114,37 +114,37 @@ discard block |
||
| 114 | 114 | $classes = 'top-menu-default'; |
| 115 | 115 | |
| 116 | 116 | //Fixed header |
| 117 | - $fixed_header = get_theme_mod('lsx_header_fixed',false); |
|
| 118 | - if(false != $fixed_header){ |
|
| 117 | + $fixed_header = get_theme_mod('lsx_header_fixed', false); |
|
| 118 | + if (false != $fixed_header) { |
|
| 119 | 119 | $classes .= ' top-menu-fixed'; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - if(false != $additional){ |
|
| 123 | - $classes .= ' '.$additional; |
|
| 122 | + if (false != $additional) { |
|
| 123 | + $classes .= ' ' . $additional; |
|
| 124 | 124 | } |
| 125 | - echo esc_attr( $classes ); |
|
| 125 | + echo esc_attr($classes); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | -add_action( 'lsx_footer_before', 'lsx_add_footer_sidebar_area' ); |
|
| 129 | -if ( ! function_exists( 'lsx_add_footer_sidebar_area' ) ) { |
|
| 128 | +add_action('lsx_footer_before', 'lsx_add_footer_sidebar_area'); |
|
| 129 | +if ( ! function_exists('lsx_add_footer_sidebar_area')) { |
|
| 130 | 130 | function lsx_add_footer_sidebar_area() { |
| 131 | - if ( is_active_sidebar( 'sidebar-footer-cta' ) ) : ?> |
|
| 131 | + if (is_active_sidebar('sidebar-footer-cta')) : ?> |
|
| 132 | 132 | <div id="footer-cta"> |
| 133 | 133 | <div class="container"> |
| 134 | 134 | <div class="lsx-full-width"> |
| 135 | 135 | <div class="lsx-hero-unit"> |
| 136 | - <?php dynamic_sidebar( 'sidebar-footer-cta' ); ?> |
|
| 136 | + <?php dynamic_sidebar('sidebar-footer-cta'); ?> |
|
| 137 | 137 | </div> |
| 138 | 138 | </div> |
| 139 | 139 | </div> |
| 140 | 140 | </div> |
| 141 | 141 | <?php endif; ?> |
| 142 | 142 | |
| 143 | - <?php if ( is_active_sidebar( 'sidebar-footer' ) ) : ?> |
|
| 143 | + <?php if (is_active_sidebar('sidebar-footer')) : ?> |
|
| 144 | 144 | <div id="footer-widgets"> |
| 145 | 145 | <div class="container"> |
| 146 | 146 | <div class="row"> |
| 147 | - <?php dynamic_sidebar( 'sidebar-footer' ); ?> |
|
| 147 | + <?php dynamic_sidebar('sidebar-footer'); ?> |
|
| 148 | 148 | </div> |
| 149 | 149 | </div> |
| 150 | 150 | </div> |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | <?php |
| 168 | 168 | else*/if (is_singular('post')) : |
| 169 | 169 | $format = get_post_format(); |
| 170 | - if ( false === $format ) { |
|
| 170 | + if (false === $format) { |
|
| 171 | 171 | $format = 'standard'; |
| 172 | 172 | } |
| 173 | 173 | $format_link = get_post_format_link($format); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | ?> |
| 176 | 176 | <header class="archive-header"> |
| 177 | 177 | <h1 class="archive-title"> |
| 178 | - <i class="format-link fa fa-<?php echo esc_attr( $format ) ?>"></i> |
|
| 178 | + <i class="format-link fa fa-<?php echo esc_attr($format) ?>"></i> |
|
| 179 | 179 | <span><?php the_title(); ?></span> |
| 180 | 180 | </h1> |
| 181 | 181 | </header> |
@@ -189,25 +189,25 @@ discard block |
||
| 189 | 189 | elseif (is_search()) : |
| 190 | 190 | ?> |
| 191 | 191 | <header class="archive-header"> |
| 192 | - <h1 class="archive-title"><?php printf( esc_html__( 'Search Results for: %s', 'lsx' ), '<span>' . get_search_query() . '</span>' ); ?></h1> |
|
| 192 | + <h1 class="archive-title"><?php printf(esc_html__('Search Results for: %s', 'lsx'), '<span>' . get_search_query() . '</span>'); ?></h1> |
|
| 193 | 193 | </header> |
| 194 | 194 | <?php |
| 195 | 195 | elseif (is_author()) : |
| 196 | 196 | ?> |
| 197 | 197 | <header class="archive-header"> |
| 198 | 198 | <h1 class="archive-title"> |
| 199 | - <?php printf( esc_html__( 'Author: %s', 'lsx' ), get_the_author() ); ?> |
|
| 199 | + <?php printf(esc_html__('Author: %s', 'lsx'), get_the_author()); ?> |
|
| 200 | 200 | </h1> |
| 201 | 201 | |
| 202 | 202 | <?php if (get_the_author_meta('description')) { ?> |
| 203 | - <p class="author-desc"><?php echo esc_html( get_the_author_meta( 'description' ) ) ?></p> |
|
| 203 | + <p class="author-desc"><?php echo esc_html(get_the_author_meta('description')) ?></p> |
|
| 204 | 204 | <?php } ?> |
| 205 | 205 | </header> |
| 206 | 206 | <?php |
| 207 | - elseif (is_archive() && class_exists('WooCommerce') && is_post_type_archive('product') ) : |
|
| 207 | + elseif (is_archive() && class_exists('WooCommerce') && is_post_type_archive('product')) : |
|
| 208 | 208 | ?> |
| 209 | 209 | <header class="archive-header"> |
| 210 | - <h1 class="archive-title"><?php esc_html_e( 'Shop', 'lsx' ); ?></h1> |
|
| 210 | + <h1 class="archive-title"><?php esc_html_e('Shop', 'lsx'); ?></h1> |
|
| 211 | 211 | <?php echo term_description(); ?> |
| 212 | 212 | </header> |
| 213 | 213 | <?php |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | ?> |
| 216 | 216 | <header class="archive-header"> |
| 217 | 217 | <h1 class="archive-title"> |
| 218 | - <?php if ( has_post_format() && !is_category() && !is_tag() && !is_date() && !is_tax('post_format') ) { ?> |
|
| 218 | + <?php if (has_post_format() && ! is_category() && ! is_tag() && ! is_date() && ! is_tax('post_format')) { ?> |
|
| 219 | 219 | Type: <?php the_archive_title(); ?> |
| 220 | 220 | <?php } else { ?> |
| 221 | 221 | <?php the_archive_title(); ?> |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | |
| 241 | 241 | if (in_array('blog', $classes)) { ?> |
| 242 | 242 | <header class="archive-header"> |
| 243 | - <h1 class="archive-title"><?php esc_html_e( 'Blog', 'lsx' ); ?></h1> |
|
| 243 | + <h1 class="archive-title"><?php esc_html_e('Blog', 'lsx'); ?></h1> |
|
| 244 | 244 | </header> |
| 245 | 245 | <?php } |
| 246 | 246 | } |
@@ -253,16 +253,16 @@ discard block |
||
| 253 | 253 | ?> |
| 254 | 254 | <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"> |
| 255 | 255 | <?php } |
| 256 | -add_action( 'wp_head', 'lsx_add_viewport_meta_tag' ); |
|
| 256 | +add_action('wp_head', 'lsx_add_viewport_meta_tag'); |
|
| 257 | 257 | |
| 258 | 258 | |
| 259 | 259 | /** |
| 260 | 260 | * Add a search form to just above the nav menu |
| 261 | 261 | */ |
| 262 | 262 | function lsx_header_search_form() { |
| 263 | - $search_form = get_theme_mod( 'lsx_header_search', 0 ); |
|
| 264 | - if($search_form || is_customize_preview()){ |
|
| 265 | - get_search_form( true ); |
|
| 263 | + $search_form = get_theme_mod('lsx_header_search', 0); |
|
| 264 | + if ($search_form || is_customize_preview()) { |
|
| 265 | + get_search_form(true); |
|
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | -add_action( 'lsx_nav_before', 'lsx_header_search_form', 0 ); |
|
| 269 | 268 | \ No newline at end of file |
| 269 | +add_action('lsx_nav_before', 'lsx_header_search_form', 0); |
|
| 270 | 270 | \ No newline at end of file |
@@ -140,6 +140,9 @@ |
||
| 140 | 140 | return self::$noscripts[(int) $match[1]]; |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | + /** |
|
| 144 | + * @param string $new_class |
|
| 145 | + */ |
|
| 143 | 146 | static function add_class( $html_string = '', $new_class ) { |
| 144 | 147 | $pattern = '/class=[\'"]([^\'"]*)[\'"]/'; |
| 145 | 148 | |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 3 | 5 | |
| 4 | 6 | /* |
| 5 | 7 | * LSX Lazy Load Images Class |
@@ -25,8 +27,9 @@ discard block |
||
| 25 | 27 | protected static $noscripts = array(); |
| 26 | 28 | |
| 27 | 29 | static function init() { |
| 28 | - if ( is_admin() ) |
|
| 29 | - return; |
|
| 30 | + if ( is_admin() ) { |
|
| 31 | + return; |
|
| 32 | + } |
|
| 30 | 33 | |
| 31 | 34 | if ( get_theme_mod( 'lsx_lazyload_status', '1' ) === false ) { |
| 32 | 35 | self::$enabled = false; |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; |
|
| 2 | +if ( ! defined('ABSPATH')) return; |
|
| 3 | 3 | |
| 4 | 4 | /* |
| 5 | 5 | * LSX Lazy Load Images Class |
@@ -25,143 +25,143 @@ discard block |
||
| 25 | 25 | protected static $noscripts = array(); |
| 26 | 26 | |
| 27 | 27 | static function init() { |
| 28 | - if ( is_admin() ) |
|
| 28 | + if (is_admin()) |
|
| 29 | 29 | return; |
| 30 | 30 | |
| 31 | - if ( get_theme_mod( 'lsx_lazyload_status', '1' ) === false ) { |
|
| 31 | + if (get_theme_mod('lsx_lazyload_status', '1') === false) { |
|
| 32 | 32 | self::$enabled = false; |
| 33 | 33 | return; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if ( ! apply_filters( 'lsx_lazyload_is_enabled', true ) ) { |
|
| 36 | + if ( ! apply_filters('lsx_lazyload_is_enabled', true)) { |
|
| 37 | 37 | self::$enabled = false; |
| 38 | 38 | return; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - add_action( 'wp_enqueue_scripts', array( __CLASS__, 'add_scripts' ) ); |
|
| 42 | - add_action( 'wp_head', array( __CLASS__, 'setup_filters' ), 9999 ); |
|
| 43 | - add_filter( 'wp_kses_allowed_html', array( __CLASS__, 'kses_allowed_html' ), 10, 2 ); |
|
| 44 | - add_filter( 'kses_allowed_protocols', array( __CLASS__, 'kses_allowed_protocols' ) ); |
|
| 41 | + add_action('wp_enqueue_scripts', array(__CLASS__, 'add_scripts')); |
|
| 42 | + add_action('wp_head', array(__CLASS__, 'setup_filters'), 9999); |
|
| 43 | + add_filter('wp_kses_allowed_html', array(__CLASS__, 'kses_allowed_html'), 10, 2); |
|
| 44 | + add_filter('kses_allowed_protocols', array(__CLASS__, 'kses_allowed_protocols')); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | static function setup_filters() { |
| 48 | 48 | // WordPress |
| 49 | - add_filter( 'the_content', array( __CLASS__, 'filter_images' ), 200 ); |
|
| 50 | - add_filter( 'widget_text', array( __CLASS__, 'filter_images' ), 200 ); |
|
| 51 | - add_filter( 'post_thumbnail_html', array( __CLASS__, 'filter_images' ), 200 ); |
|
| 52 | - add_filter( 'get_avatar', array( __CLASS__, 'filter_images' ), 200 ); |
|
| 49 | + add_filter('the_content', array(__CLASS__, 'filter_images'), 200); |
|
| 50 | + add_filter('widget_text', array(__CLASS__, 'filter_images'), 200); |
|
| 51 | + add_filter('post_thumbnail_html', array(__CLASS__, 'filter_images'), 200); |
|
| 52 | + add_filter('get_avatar', array(__CLASS__, 'filter_images'), 200); |
|
| 53 | 53 | |
| 54 | 54 | // LSX |
| 55 | - add_filter( 'lsx_lazyload_filter_images', array( __CLASS__, 'filter_images' ), 200 ); |
|
| 55 | + add_filter('lsx_lazyload_filter_images', array(__CLASS__, 'filter_images'), 200); |
|
| 56 | 56 | |
| 57 | 57 | // Envira Gallery |
| 58 | - add_filter( 'envira_gallery_output_image', array( __CLASS__, 'filter_images' ), 200 ); |
|
| 58 | + add_filter('envira_gallery_output_image', array(__CLASS__, 'filter_images'), 200); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | static function add_scripts() { |
| 62 | - wp_enqueue_script( 'lazysizes', get_template_directory_uri() .'/js/vendor/lazysizes.min.js', array( 'jquery' ), LSX_VERSION, true ); |
|
| 62 | + wp_enqueue_script('lazysizes', get_template_directory_uri() . '/js/vendor/lazysizes.min.js', array('jquery'), LSX_VERSION, true); |
|
| 63 | 63 | // Plugin that enables use lazysizes in brackground images |
| 64 | 64 | //wp_enqueue_script( 'lazysizes', get_template_directory_uri() .'/js/vendor/ls.unveilhooks.min.js', array( 'jquery', 'lazysizes' ), LSX_VERSION, true ); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - static function filter_images( $content ) { |
|
| 68 | - if ( ! self::is_enabled() ) { |
|
| 67 | + static function filter_images($content) { |
|
| 68 | + if ( ! self::is_enabled()) { |
|
| 69 | 69 | return $content; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - $http_user_agent = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); |
|
| 73 | - $http_user_agent = ! empty( $http_user_agent ) ? $http_user_agent : ''; |
|
| 72 | + $http_user_agent = sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT'])); |
|
| 73 | + $http_user_agent = ! empty($http_user_agent) ? $http_user_agent : ''; |
|
| 74 | 74 | |
| 75 | - if ( is_feed() |
|
| 75 | + if (is_feed() |
|
| 76 | 76 | || is_preview() |
| 77 | - || intval( get_query_var( 'print' ) ) == 1 |
|
| 78 | - || intval( get_query_var( 'printpage' ) ) == 1 |
|
| 79 | - || strpos( $http_user_agent, 'Opera Mini' ) !== false |
|
| 77 | + || intval(get_query_var('print')) == 1 |
|
| 78 | + || intval(get_query_var('printpage')) == 1 |
|
| 79 | + || strpos($http_user_agent, 'Opera Mini') !== false |
|
| 80 | 80 | ) { |
| 81 | 81 | return $content; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $skip_images_regex = '/class=".*(lazyload|disable-lazyload).*"/'; |
| 85 | - $placeholder_image = apply_filters( 'lsx_lazyload_placeholder_image', 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' ); |
|
| 85 | + $placeholder_image = apply_filters('lsx_lazyload_placeholder_image', 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='); |
|
| 86 | 86 | |
| 87 | 87 | $matches = array(); |
| 88 | 88 | $search = array(); |
| 89 | 89 | $replace = array(); |
| 90 | 90 | |
| 91 | - $content = preg_replace_callback( '~<noscript.+?</noscript>~s', 'self::noscripts_remove', $content ); |
|
| 92 | - preg_match_all( '/<img[^>]*>/', $content, $matches ); |
|
| 91 | + $content = preg_replace_callback('~<noscript.+?</noscript>~s', 'self::noscripts_remove', $content); |
|
| 92 | + preg_match_all('/<img[^>]*>/', $content, $matches); |
|
| 93 | 93 | |
| 94 | - foreach ( $matches[0] as $img_html ) { |
|
| 95 | - if ( ! ( preg_match( $skip_images_regex, $img_html ) ) ) { |
|
| 94 | + foreach ($matches[0] as $img_html) { |
|
| 95 | + if ( ! (preg_match($skip_images_regex, $img_html))) { |
|
| 96 | 96 | $add_class = false; |
| 97 | 97 | |
| 98 | - if ( ! preg_match( '/src=[\'"]([^\'"]+)[\'"]/', $img_html ) && preg_match( '/srcset=[\'"]([^\'"]+)[\'"]/', $img_html ) ) { |
|
| 99 | - $replace_html = preg_replace( '/<img(.*?)srcset=/i', '<img$1srcset="' . $placeholder_image . '" data-srcset=', $img_html ); |
|
| 98 | + if ( ! preg_match('/src=[\'"]([^\'"]+)[\'"]/', $img_html) && preg_match('/srcset=[\'"]([^\'"]+)[\'"]/', $img_html)) { |
|
| 99 | + $replace_html = preg_replace('/<img(.*?)srcset=/i', '<img$1srcset="' . $placeholder_image . '" data-srcset=', $img_html); |
|
| 100 | 100 | |
| 101 | - if ( preg_match( '/sizes=[\'"]([^\'"]+)[\'"]/', $img_html ) ) { |
|
| 102 | - $replace_html = preg_replace( '/sizes=/i', 'data-sizes=', $replace_html ); |
|
| 101 | + if (preg_match('/sizes=[\'"]([^\'"]+)[\'"]/', $img_html)) { |
|
| 102 | + $replace_html = preg_replace('/sizes=/i', 'data-sizes=', $replace_html); |
|
| 103 | 103 | } else { |
| 104 | - $replace_html = preg_replace( '/data-srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html ); |
|
| 104 | + $replace_html = preg_replace('/data-srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | $add_class = true; |
| 108 | - } elseif ( preg_match( '/src=[\'"]([^\'"]+)[\'"]/', $img_html ) ) { |
|
| 109 | - $replace_html = preg_replace( '/<img(.*?)src=/i', '<img$1src="' . $placeholder_image . '" data-src=', $img_html ); |
|
| 108 | + } elseif (preg_match('/src=[\'"]([^\'"]+)[\'"]/', $img_html)) { |
|
| 109 | + $replace_html = preg_replace('/<img(.*?)src=/i', '<img$1src="' . $placeholder_image . '" data-src=', $img_html); |
|
| 110 | 110 | |
| 111 | - if ( preg_match( '/srcset=[\'"]([^\'"]+)[\'"]/', $img_html ) ) { |
|
| 112 | - if ( preg_match( '/sizes=[\'"]([^\'"]+)[\'"]/', $img_html ) ) { |
|
| 113 | - $replace_html = preg_replace( '/srcset=/i', 'data-srcset=', $replace_html ); |
|
| 114 | - $replace_html = preg_replace( '/sizes=/i', 'data-sizes=', $replace_html ); |
|
| 111 | + if (preg_match('/srcset=[\'"]([^\'"]+)[\'"]/', $img_html)) { |
|
| 112 | + if (preg_match('/sizes=[\'"]([^\'"]+)[\'"]/', $img_html)) { |
|
| 113 | + $replace_html = preg_replace('/srcset=/i', 'data-srcset=', $replace_html); |
|
| 114 | + $replace_html = preg_replace('/sizes=/i', 'data-sizes=', $replace_html); |
|
| 115 | 115 | } else { |
| 116 | - $replace_html = preg_replace( '/srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html ); |
|
| 116 | + $replace_html = preg_replace('/srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html); |
|
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $add_class = true; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if ( $add_class ) { |
|
| 124 | - $replace_html = self::add_class( $replace_html, 'lazyload' ); |
|
| 123 | + if ($add_class) { |
|
| 124 | + $replace_html = self::add_class($replace_html, 'lazyload'); |
|
| 125 | 125 | $replace_html .= '<noscript>' . $img_html . '</noscript>'; |
| 126 | 126 | |
| 127 | - array_push( $search, $img_html ); |
|
| 128 | - array_push( $replace, $replace_html ); |
|
| 127 | + array_push($search, $img_html); |
|
| 128 | + array_push($replace, $replace_html); |
|
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - $content = str_replace( $search, $replace, $content ); |
|
| 134 | - $content = preg_replace_callback( '~' . chr(20) . '([0-9]+)' . chr(20) . '~', 'self::noscripts_restore', $content ); |
|
| 133 | + $content = str_replace($search, $replace, $content); |
|
| 134 | + $content = preg_replace_callback('~' . chr(20) . '([0-9]+)' . chr(20) . '~', 'self::noscripts_restore', $content); |
|
| 135 | 135 | return $content; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - static function noscripts_remove( $match ) { |
|
| 138 | + static function noscripts_remove($match) { |
|
| 139 | 139 | self::$noscript_id++; |
| 140 | 140 | self::$noscripts[self::$noscript_id] = $match[0]; |
| 141 | 141 | return chr(20) . self::$noscript_id . chr(20); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - static function noscripts_restore( $match ) { |
|
| 144 | + static function noscripts_restore($match) { |
|
| 145 | 145 | return self::$noscripts[(int) $match[1]]; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - static function add_class( $html_string = '', $new_class ) { |
|
| 148 | + static function add_class($html_string = '', $new_class) { |
|
| 149 | 149 | $pattern = '/class=[\'"]([^\'"]*)[\'"]/'; |
| 150 | 150 | |
| 151 | - if ( preg_match( $pattern, $html_string, $matches ) ) { |
|
| 152 | - $defined_classes = explode( ' ', $matches[1] ); |
|
| 151 | + if (preg_match($pattern, $html_string, $matches)) { |
|
| 152 | + $defined_classes = explode(' ', $matches[1]); |
|
| 153 | 153 | |
| 154 | - if ( ! in_array( $new_class, $defined_classes ) ) { |
|
| 154 | + if ( ! in_array($new_class, $defined_classes)) { |
|
| 155 | 155 | $defined_classes[] = $new_class; |
| 156 | 156 | |
| 157 | 157 | $html_string = str_replace( |
| 158 | 158 | $matches[0], |
| 159 | - sprintf( 'class="%s"', implode( ' ', $defined_classes ) ), |
|
| 159 | + sprintf('class="%s"', implode(' ', $defined_classes)), |
|
| 160 | 160 | $html_string |
| 161 | 161 | ); |
| 162 | 162 | } |
| 163 | 163 | } else { |
| 164 | - $html_string = preg_replace( '/(\<.+\s)/', sprintf( '$1class="%s" ', $new_class ), $html_string ); |
|
| 164 | + $html_string = preg_replace('/(\<.+\s)/', sprintf('$1class="%s" ', $new_class), $html_string); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | return $html_string; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | return self::$enabled; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - static function kses_allowed_html( $allowedtags, $context ) { |
|
| 174 | + static function kses_allowed_html($allowedtags, $context) { |
|
| 175 | 175 | $allowedtags['noscript'] = array(); |
| 176 | 176 | |
| 177 | 177 | $allowedtags['img']['data-src'] = true; |
@@ -181,10 +181,10 @@ discard block |
||
| 181 | 181 | return $allowedtags; |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | - static function kses_allowed_protocols( $allowedprotocols ) { |
|
| 184 | + static function kses_allowed_protocols($allowedprotocols) { |
|
| 185 | 185 | $allowedprotocols[] = 'data'; |
| 186 | 186 | return $allowedprotocols; |
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | -add_action( 'init', array( 'LSX_LazyLoadImages', 'init' ) ); |
|
| 190 | +add_action('init', array('LSX_LazyLoadImages', 'init')); |
|
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | * @subpackage sanitize |
| 98 | 98 | * |
| 99 | 99 | * @param array $input |
| 100 | - * @return array $output |
|
| 100 | + * @return string|false $output |
|
| 101 | 101 | */ |
| 102 | 102 | function lsx_sanitize_checkbox( $input ) { |
| 103 | 103 | if ( $input ) { |
@@ -17,14 +17,14 @@ discard block |
||
| 17 | 17 | * @param mixed $setting The setting for which the sanitizing is occurring. |
| 18 | 18 | * @return mixed The sanitized value. |
| 19 | 19 | */ |
| 20 | -function lsx_sanitize_choices( $value, $setting ) { |
|
| 21 | - if ( is_object( $setting ) ) { |
|
| 20 | +function lsx_sanitize_choices($value, $setting) { |
|
| 21 | + if (is_object($setting)) { |
|
| 22 | 22 | $setting = $setting->id; |
| 23 | 23 | } |
| 24 | - $choices = lsx_customizer_sanitize_get_choices( $setting ); |
|
| 25 | - $allowed_choices = array_keys( $choices ); |
|
| 26 | - if ( ! in_array( $value, $allowed_choices ) ) { |
|
| 27 | - $value = lsx_customizer_sanitize_get_default( $setting ); |
|
| 24 | + $choices = lsx_customizer_sanitize_get_choices($setting); |
|
| 25 | + $allowed_choices = array_keys($choices); |
|
| 26 | + if ( ! in_array($value, $allowed_choices)) { |
|
| 27 | + $value = lsx_customizer_sanitize_get_default($setting); |
|
| 28 | 28 | } |
| 29 | 29 | return $value; |
| 30 | 30 | } |
@@ -39,13 +39,13 @@ discard block |
||
| 39 | 39 | * @return mixed $field |
| 40 | 40 | */ |
| 41 | 41 | |
| 42 | -function lsx_customizer_sanitize_get_choices( $id ) { |
|
| 42 | +function lsx_customizer_sanitize_get_choices($id) { |
|
| 43 | 43 | global $lsx_customizer; |
| 44 | 44 | //LSX_Theme_Customizer |
| 45 | 45 | |
| 46 | 46 | $field = $lsx_customizer->get_control($id); |
| 47 | 47 | |
| 48 | - if ( isset( $field['choices'] ) ) { |
|
| 48 | + if (isset($field['choices'])) { |
|
| 49 | 49 | return $field['choices']; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -61,13 +61,13 @@ discard block |
||
| 61 | 61 | * @return mixed $default |
| 62 | 62 | */ |
| 63 | 63 | |
| 64 | -function lsx_customizer_sanitize_get_default( $id ) { |
|
| 64 | +function lsx_customizer_sanitize_get_default($id) { |
|
| 65 | 65 | global $lsx_customizer; |
| 66 | 66 | //LSX_Theme_Customizer |
| 67 | 67 | |
| 68 | 68 | $setting = $lsx_customizer->get_setting($id); |
| 69 | 69 | |
| 70 | - if ( isset( $setting['default'] ) ) { |
|
| 70 | + if (isset($setting['default'])) { |
|
| 71 | 71 | return $setting['default']; |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -82,12 +82,12 @@ discard block |
||
| 82 | 82 | * @param obj $setting |
| 83 | 83 | * @return string $default |
| 84 | 84 | */ |
| 85 | -function lsx_sanitize_email( $email, $setting ) { |
|
| 85 | +function lsx_sanitize_email($email, $setting) { |
|
| 86 | 86 | // Sanitize $input as a hex value without the hash prefix. |
| 87 | - $email = sanitize_email( $email ); |
|
| 87 | + $email = sanitize_email($email); |
|
| 88 | 88 | |
| 89 | 89 | // If $email is a valid email, return it; otherwise, return the default. |
| 90 | - return ( ! is_null( $email ) ? $email : $setting->default ); |
|
| 90 | + return ( ! is_null($email) ? $email : $setting->default); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
@@ -99,8 +99,8 @@ discard block |
||
| 99 | 99 | * @param array $input |
| 100 | 100 | * @return array $output |
| 101 | 101 | */ |
| 102 | -function lsx_sanitize_checkbox( $input ) { |
|
| 103 | - if ( $input ) { |
|
| 102 | +function lsx_sanitize_checkbox($input) { |
|
| 103 | + if ($input) { |
|
| 104 | 104 | $output = '1'; |
| 105 | 105 | } else { |
| 106 | 106 | $output = false; |
@@ -7,7 +7,6 @@ discard block |
||
| 7 | 7 | * @author Novrian <[email protected]> |
| 8 | 8 | * @copyright (c) 2013. Novrian Y.F. |
| 9 | 9 | * @license MIT License |
| 10 | - * @param string $sep Your custom separator |
|
| 11 | 10 | */ |
| 12 | 11 | function lsx_breadcrumbs() { |
| 13 | 12 | if (!function_exists('yoast_breadcrumb') && !function_exists('woocommerce_breadcrumb')) { |
@@ -262,7 +261,7 @@ discard block |
||
| 262 | 261 | /** |
| 263 | 262 | * Display navigation to next/previous set of posts when applicable. |
| 264 | 263 | * |
| 265 | - * @return void |
|
| 264 | + * @return null|boolean |
|
| 266 | 265 | */ |
| 267 | 266 | function lsx_paging_nav() { |
| 268 | 267 | // Don't print empty markup if there's only one page. |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | function lsx_breadcrumbs() { |
| 13 | 13 | if (!function_exists('yoast_breadcrumb') && !function_exists('woocommerce_breadcrumb')) { |
| 14 | - return null; |
|
| 14 | + return null; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | $show_on_front = get_option('show_on_front'); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * Displays logo when applicable |
| 69 | 69 | * |
| 70 | 70 | * @return void |
| 71 | - */ |
|
| 71 | + */ |
|
| 72 | 72 | function lsx_site_title() { |
| 73 | 73 | ?> |
| 74 | 74 | <div class="site-branding"> |
@@ -462,7 +462,7 @@ discard block |
||
| 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 | 468 | wp_nav_menu( array( |
@@ -574,9 +574,9 @@ discard block |
||
| 574 | 574 | if(null != $tag_cloud){ |
| 575 | 575 | echo '<h2>' . esc_html( $taxonomy ) . '</h2>'; |
| 576 | 576 | echo '<aside id="' . esc_attr( $taxonomy_id ) . '" class="widget widget_' . esc_attr( $taxonomy_id ) . '">' . esc_html( $tag_cloud ) . '</aside>'; |
| 577 | - } |
|
| 578 | - } |
|
| 579 | - } |
|
| 577 | + } |
|
| 578 | + } |
|
| 579 | + } |
|
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 | /** |
@@ -1,5 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + return; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Yoast Breadcrumbs on Twitter Bootstrap |
@@ -24,7 +27,7 @@ discard block |
||
| 24 | 27 | woocommerce_breadcrumb(); |
| 25 | 28 | $output = ob_get_clean(); |
| 26 | 29 | $output = str_replace('woocommerce-breadcrumb', 'woocommerce-breadcrumb breadcrumbs-container', $output); |
| 27 | - }elseif(function_exists('yoast_breadcrumb')){ |
|
| 30 | + } elseif(function_exists('yoast_breadcrumb')){ |
|
| 28 | 31 | // Default Yoast Breadcrumbs Separator |
| 29 | 32 | $old_sep = '\»\;'; |
| 30 | 33 | |
@@ -326,9 +329,9 @@ discard block |
||
| 326 | 329 | |
| 327 | 330 | if(current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')){ |
| 328 | 331 | return true; |
| 329 | - }elseif(function_exists('wp_pagenavi')){ |
|
| 332 | + } elseif(function_exists('wp_pagenavi')){ |
|
| 330 | 333 | wp_pagenavi(); |
| 331 | - }else{ |
|
| 334 | + } else{ |
|
| 332 | 335 | |
| 333 | 336 | $labels = array( |
| 334 | 337 | 'next' => '<span class="meta-nav">←</span> '.esc_html__( 'Older posts', 'lsx' ), |
@@ -406,9 +409,9 @@ discard block |
||
| 406 | 409 | |
| 407 | 410 | if ( function_exists('has_custom_logo') && has_custom_logo() ) { |
| 408 | 411 | the_custom_logo(); |
| 409 | - }elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { |
|
| 412 | + } elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { |
|
| 410 | 413 | jetpack_the_site_logo(); |
| 411 | - }else{ |
|
| 414 | + } else{ |
|
| 412 | 415 | // shouldn't show both together.. its just strange |
| 413 | 416 | if(true == get_theme_mod('site_logo_header_text',1)){ |
| 414 | 417 | lsx_site_title(); |
@@ -534,7 +537,7 @@ discard block |
||
| 534 | 537 | $post_type_object = get_post_type_object($post_type); |
| 535 | 538 | if(null != $post_type_object){ |
| 536 | 539 | $title = $post_type_object->labels->name; |
| 537 | - }else{ |
|
| 540 | + } else{ |
|
| 538 | 541 | $title = ucwords($post_type); |
| 539 | 542 | } |
| 540 | 543 | |
@@ -689,8 +692,9 @@ discard block |
||
| 689 | 692 | * @category urls |
| 690 | 693 | */ |
| 691 | 694 | function lsx_get_my_url() { |
| 692 | - if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) |
|
| 693 | - return false; |
|
| 695 | + if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) { |
|
| 696 | + return false; |
|
| 697 | + } |
|
| 694 | 698 | |
| 695 | 699 | return esc_url_raw( $matches[1] ); |
| 696 | 700 | } |
@@ -707,14 +711,14 @@ discard block |
||
| 707 | 711 | $part = (string) $part; |
| 708 | 712 | if ( '' !== $part ){ |
| 709 | 713 | $template = "{$slug}-{$part}.php"; |
| 710 | - }else{ |
|
| 714 | + } else{ |
|
| 711 | 715 | $template = "{$slug}.php"; |
| 712 | 716 | } |
| 713 | 717 | $file_path = apply_filters('lsx_content_path',false,$slug,$part); |
| 714 | 718 | |
| 715 | 719 | if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) { |
| 716 | 720 | load_template( $file_path.$template, false ); |
| 717 | - }else{ |
|
| 721 | + } else{ |
|
| 718 | 722 | get_template_part($slug,$part); |
| 719 | 723 | } |
| 720 | 724 | } |
| 721 | 725 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Yoast Breadcrumbs on Twitter Bootstrap |
@@ -10,21 +10,21 @@ discard block |
||
| 10 | 10 | * @param string $sep Your custom separator |
| 11 | 11 | */ |
| 12 | 12 | function lsx_breadcrumbs() { |
| 13 | - if (!function_exists('yoast_breadcrumb') && !function_exists('woocommerce_breadcrumb')) { |
|
| 13 | + if ( ! function_exists('yoast_breadcrumb') && ! function_exists('woocommerce_breadcrumb')) { |
|
| 14 | 14 | return null; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | $show_on_front = get_option('show_on_front'); |
| 18 | - if ( ('posts' == $show_on_front && is_home()) || ('page' == $show_on_front && is_front_page()) ) { |
|
| 18 | + if (('posts' == $show_on_front && is_home()) || ('page' == $show_on_front && is_front_page())) { |
|
| 19 | 19 | return; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - if(function_exists('woocommerce_breadcrumb')){ |
|
| 22 | + if (function_exists('woocommerce_breadcrumb')) { |
|
| 23 | 23 | ob_start(); |
| 24 | 24 | woocommerce_breadcrumb(); |
| 25 | 25 | $output = ob_get_clean(); |
| 26 | 26 | $output = str_replace('woocommerce-breadcrumb', 'woocommerce-breadcrumb breadcrumbs-container', $output); |
| 27 | - }elseif(function_exists('yoast_breadcrumb')){ |
|
| 27 | + }elseif (function_exists('yoast_breadcrumb')) { |
|
| 28 | 28 | // Default Yoast Breadcrumbs Separator |
| 29 | 29 | $old_sep = '\»\;'; |
| 30 | 30 | |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | $output = '<div class="breadcrumbs-container">' . $output . '</div>'; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - $output = apply_filters('lsx_breadcrumbs',$output); |
|
| 45 | + $output = apply_filters('lsx_breadcrumbs', $output); |
|
| 46 | 46 | |
| 47 | - echo wp_kses_post( $output ); |
|
| 47 | + echo wp_kses_post($output); |
|
| 48 | 48 | } |
| 49 | -add_action( 'lsx_content_top', 'lsx_breadcrumbs', 100 ); |
|
| 49 | +add_action('lsx_content_top', 'lsx_breadcrumbs', 100); |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Replaces the seperator with a blank space. |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | function lsx_breadcrumbs_seperator_filter($seperator) { |
| 56 | 56 | return ''; |
| 57 | 57 | } |
| 58 | -add_filter( 'wpseo_breadcrumb_separator', 'lsx_breadcrumbs_seperator_filter' ); |
|
| 58 | +add_filter('wpseo_breadcrumb_separator', 'lsx_breadcrumbs_seperator_filter'); |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * Custom template tags for this theme. |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * @package lsx |
| 65 | 65 | */ |
| 66 | -if ( ! function_exists( 'lsx_site_title' ) ) : |
|
| 66 | +if ( ! function_exists('lsx_site_title')) : |
|
| 67 | 67 | /** |
| 68 | 68 | * Displays logo when applicable |
| 69 | 69 | * |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | function lsx_site_title() { |
| 73 | 73 | ?> |
| 74 | 74 | <div class="site-branding"> |
| 75 | - <h1 class="site-title"><a title="<?php bloginfo( 'name' ); ?>" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> |
|
| 76 | - <p class="site-description"><?php bloginfo( 'description' ); ?></p> |
|
| 75 | + <h1 class="site-title"><a title="<?php bloginfo('name'); ?>" href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></h1> |
|
| 76 | + <p class="site-description"><?php bloginfo('description'); ?></p> |
|
| 77 | 77 | </div> |
| 78 | 78 | <?php |
| 79 | 79 | } |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | /** |
| 83 | 83 | * Add customisable post meta. |
| 84 | 84 | */ |
| 85 | -if ( ! function_exists( 'lsx_post_meta' ) ) { |
|
| 85 | +if ( ! function_exists('lsx_post_meta')) { |
|
| 86 | 86 | function lsx_post_meta() { |
| 87 | - if ( ( is_page() && ! ( is_home() || is_front_page() ) ) && ! is_page_template( 'page-templates/template-blog.php' ) ) { |
|
| 87 | + if ((is_page() && ! (is_home() || is_front_page())) && ! is_page_template('page-templates/template-blog.php')) { |
|
| 88 | 88 | return; |
| 89 | 89 | } |
| 90 | 90 | ?> |
@@ -99,94 +99,94 @@ discard block |
||
| 99 | 99 | /** |
| 100 | 100 | * Add customisable post meta: post date |
| 101 | 101 | */ |
| 102 | -if ( ! function_exists( 'lsx_post_meta_date' ) ) { |
|
| 102 | +if ( ! function_exists('lsx_post_meta_date')) { |
|
| 103 | 103 | function lsx_post_meta_date() { |
| 104 | 104 | $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; |
| 105 | 105 | |
| 106 | - $time_string = sprintf( $time_string, |
|
| 107 | - esc_attr( get_the_date( 'c' ) ), |
|
| 106 | + $time_string = sprintf($time_string, |
|
| 107 | + esc_attr(get_the_date('c')), |
|
| 108 | 108 | get_the_date(), |
| 109 | - esc_attr( get_the_modified_date( 'c' ) ), |
|
| 109 | + esc_attr(get_the_modified_date('c')), |
|
| 110 | 110 | get_the_modified_date() |
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | - printf( '<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>', |
|
| 114 | - esc_html_x( 'Posted on:', 'Used before publish date.', 'lsx' ), |
|
| 115 | - esc_url( get_permalink() ), |
|
| 116 | - wp_kses_post( $time_string ) |
|
| 113 | + printf('<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>', |
|
| 114 | + esc_html_x('Posted on:', 'Used before publish date.', 'lsx'), |
|
| 115 | + esc_url(get_permalink()), |
|
| 116 | + wp_kses_post($time_string) |
|
| 117 | 117 | ); |
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_date', 10 ); |
|
| 120 | +add_action('lsx_content_post_meta', 'lsx_post_meta_date', 10); |
|
| 121 | 121 | |
| 122 | 122 | /** |
| 123 | 123 | * Add customisable post meta: post author |
| 124 | 124 | */ |
| 125 | -if ( ! function_exists( 'lsx_post_meta_author' ) ) { |
|
| 125 | +if ( ! function_exists('lsx_post_meta_author')) { |
|
| 126 | 126 | function lsx_post_meta_author() { |
| 127 | 127 | $author = get_the_author(); |
| 128 | - $author_url = esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); |
|
| 128 | + $author_url = esc_url(get_author_posts_url(get_the_author_meta('ID'))); |
|
| 129 | 129 | |
| 130 | - if ( empty( $author ) ) { |
|
| 130 | + if (empty($author)) { |
|
| 131 | 131 | global $post; |
| 132 | 132 | |
| 133 | - $author = get_user_by( 'ID', $post->post_author ); |
|
| 133 | + $author = get_user_by('ID', $post->post_author); |
|
| 134 | 134 | $author = $author->display_name; |
| 135 | - $author_url = esc_url( get_author_posts_url( $post->post_author ) ); |
|
| 135 | + $author_url = esc_url(get_author_posts_url($post->post_author)); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - printf( '<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>', |
|
| 139 | - esc_html_x( 'Posted by:', 'Used before post author name.', 'lsx' ), |
|
| 138 | + printf('<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>', |
|
| 139 | + esc_html_x('Posted by:', 'Used before post author name.', 'lsx'), |
|
| 140 | 140 | $author_url, |
| 141 | 141 | $author |
| 142 | 142 | ); |
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_author', 20 ); |
|
| 145 | +add_action('lsx_content_post_meta', 'lsx_post_meta_author', 20); |
|
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | 148 | * Add customisable post meta: post category(ies) |
| 149 | 149 | */ |
| 150 | -if ( ! function_exists( 'lsx_post_meta_category' ) ) { |
|
| 150 | +if ( ! function_exists('lsx_post_meta_category')) { |
|
| 151 | 151 | function lsx_post_meta_category() { |
| 152 | - $post_categories = wp_get_post_categories( get_the_ID() ); |
|
| 152 | + $post_categories = wp_get_post_categories(get_the_ID()); |
|
| 153 | 153 | $cats = array(); |
| 154 | 154 | |
| 155 | - foreach( $post_categories as $c ) { |
|
| 156 | - $cat = get_category( $c ); |
|
| 157 | - $cats[] = '<a href="' . get_category_link( $cat->term_id ) . '" title="' . sprintf( esc_html__( 'View all posts in %s' , 'lsx' ), $cat->name ) . '" ' . '>' . $cat->name . '</a>'; |
|
| 155 | + foreach ($post_categories as $c) { |
|
| 156 | + $cat = get_category($c); |
|
| 157 | + $cats[] = '<a href="' . get_category_link($cat->term_id) . '" title="' . sprintf(esc_html__('View all posts in %s', 'lsx'), $cat->name) . '" ' . '>' . $cat->name . '</a>'; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - if ( ! empty( $cats ) ) { |
|
| 160 | + if ( ! empty($cats)) { |
|
| 161 | 161 | ?> |
| 162 | - <span class="post-meta-categories"><span><?php esc_html_e( 'Posted in:', 'lsx' ); ?></span> <?php echo wp_kses_post( implode( ', ', $cats ) ); ?></span> |
|
| 162 | + <span class="post-meta-categories"><span><?php esc_html_e('Posted in:', 'lsx'); ?></span> <?php echo wp_kses_post(implode(', ', $cats)); ?></span> |
|
| 163 | 163 | <?php |
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_category', 30 ); |
|
| 167 | +add_action('lsx_content_post_meta', 'lsx_post_meta_category', 30); |
|
| 168 | 168 | |
| 169 | 169 | /** |
| 170 | 170 | * Add customisable post meta: post tag(s) |
| 171 | 171 | */ |
| 172 | -if ( ! function_exists( 'lsx_post_tags' ) ) { |
|
| 172 | +if ( ! function_exists('lsx_post_tags')) { |
|
| 173 | 173 | function lsx_post_tags() { |
| 174 | - if ( has_tag() ) : |
|
| 174 | + if (has_tag()) : |
|
| 175 | 175 | ?> |
| 176 | 176 | <div class="post-tags"> |
| 177 | - <span><?php esc_html_e( 'Tagged as:', 'lsx' ); ?></span> <?php echo wp_kses_post( get_the_tag_list( '' ) ); ?> |
|
| 177 | + <span><?php esc_html_e('Tagged as:', 'lsx'); ?></span> <?php echo wp_kses_post(get_the_tag_list('')); ?> |
|
| 178 | 178 | </div> |
| 179 | 179 | <?php |
| 180 | 180 | endif; |
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | -add_action( 'lsx_content_post_tags', 'lsx_post_tags', 10 ); |
|
| 183 | +add_action('lsx_content_post_tags', 'lsx_post_tags', 10); |
|
| 184 | 184 | |
| 185 | 185 | /** |
| 186 | 186 | * Add customisable post info: related posts |
| 187 | 187 | */ |
| 188 | 188 | function lsx_related_posts() { |
| 189 | - if ( is_singular( 'post' ) && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
| 189 | + if (is_singular('post') && class_exists('Jetpack_RelatedPosts')) { |
|
| 190 | 190 | ?> |
| 191 | 191 | <div class="row row-related-posts"> |
| 192 | 192 | <div class="col-md-12"> |
@@ -196,15 +196,15 @@ discard block |
||
| 196 | 196 | <?php |
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | -add_action( 'lsx_entry_bottom', 'lsx_related_posts', 10 ); |
|
| 199 | +add_action('lsx_entry_bottom', 'lsx_related_posts', 10); |
|
| 200 | 200 | |
| 201 | 201 | /** |
| 202 | 202 | * Translate post format to Font Awesome class |
| 203 | 203 | */ |
| 204 | 204 | |
| 205 | -if ( ! function_exists( 'lsx_translate_format_to_fontawesome' ) ) { |
|
| 206 | - function lsx_translate_format_to_fontawesome( $format ) { |
|
| 207 | - switch ( $format ) { |
|
| 205 | +if ( ! function_exists('lsx_translate_format_to_fontawesome')) { |
|
| 206 | + function lsx_translate_format_to_fontawesome($format) { |
|
| 207 | + switch ($format) { |
|
| 208 | 208 | case 'image': |
| 209 | 209 | $format = 'camera'; |
| 210 | 210 | break; |
@@ -249,45 +249,45 @@ discard block |
||
| 249 | 249 | * to be added/modified where necessary. |
| 250 | 250 | */ |
| 251 | 251 | |
| 252 | -if ( ! function_exists( 'lsx_portfolio_meta' ) ) { |
|
| 252 | +if ( ! function_exists('lsx_portfolio_meta')) { |
|
| 253 | 253 | function lsx_portfolio_meta() { |
| 254 | 254 | ?> |
| 255 | 255 | <div id="portfolio-meta" class="portfolio-meta info-box-sticky info-box sticky-wrapper"> |
| 256 | 256 | <?php |
| 257 | - $client = get_post_meta(get_the_ID(),'lsx-client',true); |
|
| 258 | - if(false != $client){ ?> |
|
| 257 | + $client = get_post_meta(get_the_ID(), 'lsx-client', true); |
|
| 258 | + if (false != $client) { ?> |
|
| 259 | 259 | <div class="portfolio-client"> |
| 260 | - <span><span class="fa fa-user"></span><?php esc_html_e( 'Client','lsx' ); ?></span> |
|
| 261 | - <span><?php echo esc_html( $client ); ?></span> |
|
| 260 | + <span><span class="fa fa-user"></span><?php esc_html_e('Client', 'lsx'); ?></span> |
|
| 261 | + <span><?php echo esc_html($client); ?></span> |
|
| 262 | 262 | </div> |
| 263 | 263 | <?php } ?> |
| 264 | 264 | |
| 265 | 265 | <?php |
| 266 | - $portfolio_type = get_the_term_list( get_the_ID(), 'jetpack-portfolio-type', '', ', ', '' ); |
|
| 266 | + $portfolio_type = get_the_term_list(get_the_ID(), 'jetpack-portfolio-type', '', ', ', ''); |
|
| 267 | 267 | |
| 268 | - if($portfolio_type){ |
|
| 268 | + if ($portfolio_type) { |
|
| 269 | 269 | ?> |
| 270 | 270 | <div class="portfolio-industry"> |
| 271 | - <span><span class="fa fa-folder-open"></span><?php esc_html_e( 'Industry', 'lsx' ); ?></span> |
|
| 272 | - <?php echo wp_kses_post( $portfolio_type ); ?> |
|
| 271 | + <span><span class="fa fa-folder-open"></span><?php esc_html_e('Industry', 'lsx'); ?></span> |
|
| 272 | + <?php echo wp_kses_post($portfolio_type); ?> |
|
| 273 | 273 | </div> |
| 274 | 274 | <?php } ?> |
| 275 | 275 | |
| 276 | 276 | <?php |
| 277 | - $services = get_the_term_list( get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '' ); |
|
| 278 | - if(false != $services){ ?> |
|
| 277 | + $services = get_the_term_list(get_the_ID(), 'jetpack-portfolio-tag', '', ', ', ''); |
|
| 278 | + if (false != $services) { ?> |
|
| 279 | 279 | <div class="portfolio-services"> |
| 280 | - <span><span class="fa fa-cog"></span><?php esc_html_e( 'Services', 'lsx' ); ?></span> |
|
| 281 | - <?php echo wp_kses_post( $services ); ?> |
|
| 280 | + <span><span class="fa fa-cog"></span><?php esc_html_e('Services', 'lsx'); ?></span> |
|
| 281 | + <?php echo wp_kses_post($services); ?> |
|
| 282 | 282 | </div> |
| 283 | 283 | <?php } ?> |
| 284 | 284 | |
| 285 | 285 | <?php |
| 286 | - $website = esc_url( get_post_meta(get_the_ID(),'lsx-website',true) ); |
|
| 287 | - if(false != $website){ ?> |
|
| 286 | + $website = esc_url(get_post_meta(get_the_ID(), 'lsx-website', true)); |
|
| 287 | + if (false != $website) { ?> |
|
| 288 | 288 | <div class="portfolio-website"> |
| 289 | - <span><span class="fa fa-link"></span><?php esc_html_e( 'Website', 'lsx' ); ?></span> |
|
| 290 | - <a target="_blank" href="<?php echo esc_url( $website ); ?>"><?php echo esc_html( $website ) ?></a> |
|
| 289 | + <span><span class="fa fa-link"></span><?php esc_html_e('Website', 'lsx'); ?></span> |
|
| 290 | + <a target="_blank" href="<?php echo esc_url($website); ?>"><?php echo esc_html($website) ?></a> |
|
| 291 | 291 | </div> |
| 292 | 292 | <?php } ?> |
| 293 | 293 | |
@@ -301,29 +301,29 @@ discard block |
||
| 301 | 301 | * |
| 302 | 302 | */ |
| 303 | 303 | |
| 304 | -if ( ! function_exists( 'lsx_portfolio_gallery' ) ) { |
|
| 304 | +if ( ! function_exists('lsx_portfolio_gallery')) { |
|
| 305 | 305 | function lsx_portfolio_gallery() { |
| 306 | 306 | |
| 307 | - $media = get_attached_media( 'image' ); |
|
| 307 | + $media = get_attached_media('image'); |
|
| 308 | 308 | $media_array = array(); |
| 309 | 309 | $post_thumbnail_id = get_post_thumbnail_id(get_the_ID()); |
| 310 | 310 | |
| 311 | - if(!empty($media)){ |
|
| 312 | - foreach($media as $media_item){ |
|
| 313 | - if($post_thumbnail_id != $media_item->ID) { |
|
| 311 | + if ( ! empty($media)) { |
|
| 312 | + foreach ($media as $media_item) { |
|
| 313 | + if ($post_thumbnail_id != $media_item->ID) { |
|
| 314 | 314 | $media_array[] = $media_item->ID; |
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | - if(!empty($media_array)){ |
|
| 319 | - echo wp_kses_post( gallery_shortcode( array( 'size' => 'full', 'ids' => implode( ',', $media_array ) ) ) ); |
|
| 318 | + if ( ! empty($media_array)) { |
|
| 319 | + echo wp_kses_post(gallery_shortcode(array('size' => 'full', 'ids' => implode(',', $media_array)))); |
|
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | } |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | -if ( ! function_exists( 'lsx_paging_nav' ) ) : |
|
| 326 | +if ( ! function_exists('lsx_paging_nav')) : |
|
| 327 | 327 | /** |
| 328 | 328 | * Display navigation to next/previous set of posts when applicable. |
| 329 | 329 | * |
@@ -331,33 +331,33 @@ discard block |
||
| 331 | 331 | */ |
| 332 | 332 | function lsx_paging_nav() { |
| 333 | 333 | // Don't print empty markup if there's only one page. |
| 334 | - if ( $GLOBALS['wp_query']->max_num_pages < 2 ) { |
|
| 334 | + if ($GLOBALS['wp_query']->max_num_pages < 2) { |
|
| 335 | 335 | return; |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | - if(current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')){ |
|
| 338 | + if (current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')) { |
|
| 339 | 339 | return true; |
| 340 | - }elseif(function_exists('wp_pagenavi')){ |
|
| 340 | + }elseif (function_exists('wp_pagenavi')) { |
|
| 341 | 341 | wp_pagenavi(); |
| 342 | - }else{ |
|
| 342 | + } else { |
|
| 343 | 343 | |
| 344 | 344 | $labels = array( |
| 345 | - 'next' => '<span class="meta-nav">←</span> '.esc_html__( 'Older posts', 'lsx' ), |
|
| 346 | - 'previous' => esc_html__( 'Newer posts', 'lsx' ).' <span class="meta-nav">→</span>', |
|
| 347 | - 'title' => esc_html__( 'Posts navigation', 'lsx' ) |
|
| 345 | + 'next' => '<span class="meta-nav">←</span> ' . esc_html__('Older posts', 'lsx'), |
|
| 346 | + 'previous' => esc_html__('Newer posts', 'lsx') . ' <span class="meta-nav">→</span>', |
|
| 347 | + 'title' => esc_html__('Posts navigation', 'lsx') |
|
| 348 | 348 | ); |
| 349 | - $labels = apply_filters('lsx_post_navigation_labels',$labels); |
|
| 349 | + $labels = apply_filters('lsx_post_navigation_labels', $labels); |
|
| 350 | 350 | ?> |
| 351 | 351 | <nav class="navigation paging-navigation" role="navigation"> |
| 352 | 352 | <div class="lsx-breaker"></div> |
| 353 | - <h1 class="screen-reader-text"><?php echo esc_html( $labels['title'] ); ?></h1> |
|
| 353 | + <h1 class="screen-reader-text"><?php echo esc_html($labels['title']); ?></h1> |
|
| 354 | 354 | <div class="nav-links"> |
| 355 | - <?php if ( get_next_posts_link() ) : ?> |
|
| 356 | - <div class="nav-previous"><?php next_posts_link( $labels['next'] ); ?></div> |
|
| 355 | + <?php if (get_next_posts_link()) : ?> |
|
| 356 | + <div class="nav-previous"><?php next_posts_link($labels['next']); ?></div> |
|
| 357 | 357 | <?php endif; ?> |
| 358 | 358 | |
| 359 | - <?php if ( get_previous_posts_link() ) : ?> |
|
| 360 | - <div class="nav-next"><?php previous_posts_link( $labels['previous'] ); ?></div> |
|
| 359 | + <?php if (get_previous_posts_link()) : ?> |
|
| 360 | + <div class="nav-next"><?php previous_posts_link($labels['previous']); ?></div> |
|
| 361 | 361 | <?php endif; ?> |
| 362 | 362 | |
| 363 | 363 | <div class="clearfix"></div> |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | } |
| 369 | 369 | endif; |
| 370 | 370 | |
| 371 | -if ( ! function_exists( 'lsx_post_nav' ) ) : |
|
| 371 | +if ( ! function_exists('lsx_post_nav')) : |
|
| 372 | 372 | /** |
| 373 | 373 | * Display navigation to next/previous post when applicable. |
| 374 | 374 | * |
@@ -376,10 +376,10 @@ discard block |
||
| 376 | 376 | */ |
| 377 | 377 | function lsx_post_nav() { |
| 378 | 378 | // Don't print empty markup if there's nowhere to navigate. |
| 379 | - $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); |
|
| 380 | - $next = get_adjacent_post( false, '', false ); |
|
| 379 | + $previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true); |
|
| 380 | + $next = get_adjacent_post(false, '', false); |
|
| 381 | 381 | |
| 382 | - if ( ! $next && ! $previous ) { |
|
| 382 | + if ( ! $next && ! $previous) { |
|
| 383 | 383 | return; |
| 384 | 384 | } |
| 385 | 385 | ?> |
@@ -389,14 +389,14 @@ discard block |
||
| 389 | 389 | <div class="nav-links pager row"> |
| 390 | 390 | <div class="previous col-md-6"> |
| 391 | 391 | <?php |
| 392 | - $previous_post = get_previous_post_link( '%link', '<p class="nav-links-description">'._x( 'Previous Post', 'Previous post link', 'lsx' ).'</p><h3>%title</h3>' ); |
|
| 393 | - echo wp_kses_post( $previous_post ); |
|
| 392 | + $previous_post = get_previous_post_link('%link', '<p class="nav-links-description">' . _x('Previous Post', 'Previous post link', 'lsx') . '</p><h3>%title</h3>'); |
|
| 393 | + echo wp_kses_post($previous_post); |
|
| 394 | 394 | ?> |
| 395 | 395 | </div> |
| 396 | 396 | <div class="next col-md-6"> |
| 397 | 397 | <?php |
| 398 | - $next_post = get_next_post_link( '%link', '<p class="nav-links-description">'._x( 'Next Post', 'Next post link', 'lsx' ).'</p><h3>%title</h3>' ); |
|
| 399 | - echo wp_kses_post( $next_post ); |
|
| 398 | + $next_post = get_next_post_link('%link', '<p class="nav-links-description">' . _x('Next Post', 'Next post link', 'lsx') . '</p><h3>%title</h3>'); |
|
| 399 | + echo wp_kses_post($next_post); |
|
| 400 | 400 | ?> |
| 401 | 401 | </div> |
| 402 | 402 | </div><!-- .nav-links --> |
@@ -412,16 +412,16 @@ discard block |
||
| 412 | 412 | * @subpackage template-tags |
| 413 | 413 | * @category header |
| 414 | 414 | */ |
| 415 | -if(!function_exists('lsx_site_identity')){ |
|
| 416 | - function lsx_site_identity(){ |
|
| 415 | +if ( ! function_exists('lsx_site_identity')) { |
|
| 416 | + function lsx_site_identity() { |
|
| 417 | 417 | |
| 418 | - if ( function_exists('has_custom_logo') && has_custom_logo() ) { |
|
| 418 | + if (function_exists('has_custom_logo') && has_custom_logo()) { |
|
| 419 | 419 | the_custom_logo(); |
| 420 | - }elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { |
|
| 420 | + }elseif (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) { |
|
| 421 | 421 | jetpack_the_site_logo(); |
| 422 | - }else{ |
|
| 422 | + } else { |
|
| 423 | 423 | // shouldn't show both together.. its just strange |
| 424 | - if(true == get_theme_mod('site_logo_header_text',1)){ |
|
| 424 | + if (true == get_theme_mod('site_logo_header_text', 1)) { |
|
| 425 | 425 | lsx_site_title(); |
| 426 | 426 | } |
| 427 | 427 | } |
@@ -436,29 +436,29 @@ discard block |
||
| 436 | 436 | * @subpackage template-tags |
| 437 | 437 | * @category navigation |
| 438 | 438 | */ |
| 439 | -if(!function_exists('lsx_navbar_header')){ |
|
| 440 | - function lsx_navbar_header(){ ?> |
|
| 439 | +if ( ! function_exists('lsx_navbar_header')) { |
|
| 440 | + function lsx_navbar_header() { ?> |
|
| 441 | 441 | <div class="navbar-header" itemscope itemtype="http://schema.org/WebPage"> |
| 442 | 442 | |
| 443 | 443 | <?php |
| 444 | - $nav_menu = get_theme_mod('nav_menu_locations',false); |
|
| 444 | + $nav_menu = get_theme_mod('nav_menu_locations', false); |
|
| 445 | 445 | //print_r(get_nav_menu_locations()); |
| 446 | 446 | |
| 447 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
| 447 | + if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?> |
|
| 448 | 448 | <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".primary-navbar"> |
| 449 | - <span class="sr-only"><?php esc_html_e( 'Toggle navigation', 'lsx' ); ?></span> |
|
| 449 | + <span class="sr-only"><?php esc_html_e('Toggle navigation', 'lsx'); ?></span> |
|
| 450 | 450 | <span class="icon-bar"></span> |
| 451 | 451 | <span class="icon-bar"></span> |
| 452 | 452 | <span class="icon-bar"></span> |
| 453 | 453 | </button> |
| 454 | - <span class="mobile-menu-title"><?php esc_html_e( 'Menu', 'lsx' ); ?></span> |
|
| 454 | + <span class="mobile-menu-title"><?php esc_html_e('Menu', 'lsx'); ?></span> |
|
| 455 | 455 | <?php } ?> |
| 456 | 456 | <?php lsx_site_identity(); ?> |
| 457 | 457 | </div> |
| 458 | 458 | <?php } |
| 459 | 459 | } |
| 460 | 460 | //the if statement is for backwards compatability with previous versions of the theme. |
| 461 | -add_action('lsx_nav_before','lsx_navbar_header'); |
|
| 461 | +add_action('lsx_nav_before', 'lsx_navbar_header'); |
|
| 462 | 462 | |
| 463 | 463 | /** |
| 464 | 464 | * Outputs the Nav Menu |
@@ -467,16 +467,16 @@ discard block |
||
| 467 | 467 | * @subpackage template-tags |
| 468 | 468 | * @category navigation |
| 469 | 469 | */ |
| 470 | -if(!function_exists('lsx_nav_menu')){ |
|
| 471 | - function lsx_nav_menu(){ |
|
| 472 | - $nav_menu = get_theme_mod('nav_menu_locations',false); |
|
| 470 | +if ( ! function_exists('lsx_nav_menu')) { |
|
| 471 | + function lsx_nav_menu() { |
|
| 472 | + $nav_menu = get_theme_mod('nav_menu_locations', false); |
|
| 473 | 473 | |
| 474 | 474 | //print_r(get_nav_menu_locations()); |
| 475 | 475 | |
| 476 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
| 476 | + if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?> |
|
| 477 | 477 | <nav class="primary-navbar collapse navbar-collapse"> |
| 478 | 478 | <?php |
| 479 | - wp_nav_menu( array( |
|
| 479 | + wp_nav_menu(array( |
|
| 480 | 480 | 'theme_location' => 'primary', |
| 481 | 481 | 'menu' => $nav_menu['primary'], |
| 482 | 482 | 'depth' => 3, |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | * @subpackage template-tags |
| 498 | 498 | * @category sitemap |
| 499 | 499 | */ |
| 500 | -function lsx_sitemap_pages(){ |
|
| 500 | +function lsx_sitemap_pages() { |
|
| 501 | 501 | $page_args = array( |
| 502 | 502 | 'post_type' => 'page', |
| 503 | 503 | 'posts_per_page'=> 99, |
@@ -505,13 +505,13 @@ discard block |
||
| 505 | 505 | 'post_type' => 'page', |
| 506 | 506 | ); |
| 507 | 507 | $pages = new WP_Query($page_args); |
| 508 | - if($pages->have_posts()){ |
|
| 508 | + if ($pages->have_posts()) { |
|
| 509 | 509 | |
| 510 | - echo '<h2>' . esc_html__( 'Pages', 'lsx' ) . '</h2>'; |
|
| 510 | + echo '<h2>' . esc_html__('Pages', 'lsx') . '</h2>'; |
|
| 511 | 511 | |
| 512 | 512 | echo '<ul>'; |
| 513 | - while($pages->have_posts()){ $pages->the_post(); |
|
| 514 | - echo '<li class="page_item page-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>'; |
|
| 513 | + while ($pages->have_posts()) { $pages->the_post(); |
|
| 514 | + echo '<li class="page_item page-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>'; |
|
| 515 | 515 | } |
| 516 | 516 | echo '</ul>'; |
| 517 | 517 | |
@@ -526,13 +526,13 @@ discard block |
||
| 526 | 526 | * @subpackage template-tags |
| 527 | 527 | * @category sitemap |
| 528 | 528 | */ |
| 529 | -function lsx_sitemap_custom_post_type(){ |
|
| 529 | +function lsx_sitemap_custom_post_type() { |
|
| 530 | 530 | $args = array( |
| 531 | 531 | 'public' => true, |
| 532 | 532 | '_builtin' => false |
| 533 | 533 | ); |
| 534 | - $post_types = get_post_types($args , 'names'); |
|
| 535 | - foreach($post_types as $post_type){ |
|
| 534 | + $post_types = get_post_types($args, 'names'); |
|
| 535 | + foreach ($post_types as $post_type) { |
|
| 536 | 536 | |
| 537 | 537 | $post_type_args = array( |
| 538 | 538 | 'post_type' => 'page', |
@@ -543,19 +543,19 @@ discard block |
||
| 543 | 543 | $post_type_items = new WP_Query($post_type_args); |
| 544 | 544 | |
| 545 | 545 | $post_type_object = get_post_type_object($post_type); |
| 546 | - if(null != $post_type_object){ |
|
| 546 | + if (null != $post_type_object) { |
|
| 547 | 547 | $title = $post_type_object->labels->name; |
| 548 | - }else{ |
|
| 548 | + } else { |
|
| 549 | 549 | $title = ucwords($post_type); |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | - if($post_type_items->have_posts()){ |
|
| 552 | + if ($post_type_items->have_posts()) { |
|
| 553 | 553 | |
| 554 | - echo '<h2>' . esc_html( $title ) . '</h2>'; |
|
| 554 | + echo '<h2>' . esc_html($title) . '</h2>'; |
|
| 555 | 555 | |
| 556 | 556 | echo '<ul>'; |
| 557 | - while($post_type_items->have_posts()){ $post_type_items->the_post(); |
|
| 558 | - echo '<li class="' . esc_attr( get_post_type() ) . '_item ' . esc_attr( get_post_type() ) . '-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>'; |
|
| 557 | + while ($post_type_items->have_posts()) { $post_type_items->the_post(); |
|
| 558 | + echo '<li class="' . esc_attr(get_post_type()) . '_item ' . esc_attr(get_post_type()) . '-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>'; |
|
| 559 | 559 | } |
| 560 | 560 | echo '</ul>'; |
| 561 | 561 | |
@@ -571,20 +571,20 @@ discard block |
||
| 571 | 571 | * @subpackage template-tags |
| 572 | 572 | * @category sitemap |
| 573 | 573 | */ |
| 574 | -function lsx_sitemap_taxonomy_clouds(){ |
|
| 574 | +function lsx_sitemap_taxonomy_clouds() { |
|
| 575 | 575 | |
| 576 | - $taxonomy_args = array( |
|
| 576 | + $taxonomy_args = array( |
|
| 577 | 577 | 'public' => true, |
| 578 | 578 | '_builtin' => false |
| 579 | 579 | ); |
| 580 | 580 | $taxonomies = get_taxonomies($taxonomy_args); |
| 581 | - if(!empty($taxonomies)){ |
|
| 582 | - foreach($taxonomies as $taxonomy_id => $taxonomy) { |
|
| 581 | + if ( ! empty($taxonomies)) { |
|
| 582 | + foreach ($taxonomies as $taxonomy_id => $taxonomy) { |
|
| 583 | 583 | |
| 584 | - $tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id,'echo'=>false)); |
|
| 585 | - if(null != $tag_cloud){ |
|
| 586 | - echo '<h2>' . esc_html( $taxonomy ) . '</h2>'; |
|
| 587 | - echo '<aside id="' . esc_attr( $taxonomy_id ) . '" class="widget widget_' . esc_attr( $taxonomy_id ) . '">' . esc_html( $tag_cloud ) . '</aside>'; |
|
| 584 | + $tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id, 'echo'=>false)); |
|
| 585 | + if (null != $tag_cloud) { |
|
| 586 | + echo '<h2>' . esc_html($taxonomy) . '</h2>'; |
|
| 587 | + echo '<aside id="' . esc_attr($taxonomy_id) . '" class="widget widget_' . esc_attr($taxonomy_id) . '">' . esc_html($tag_cloud) . '</aside>'; |
|
| 588 | 588 | } |
| 589 | 589 | } |
| 590 | 590 | } |
@@ -597,15 +597,15 @@ discard block |
||
| 597 | 597 | * @subpackage hooks |
| 598 | 598 | * @category forms |
| 599 | 599 | */ |
| 600 | -add_action( 'lsx_footer_before', 'lsx_footer_subscription_cta', 10 ); |
|
| 600 | +add_action('lsx_footer_before', 'lsx_footer_subscription_cta', 10); |
|
| 601 | 601 | function lsx_footer_subscription_cta() { |
| 602 | - if(!function_exists('lsx_is_form_enabled')){ return; } |
|
| 602 | + if ( ! function_exists('lsx_is_form_enabled')) { return; } |
|
| 603 | 603 | $subscribe_form_id = lsx_is_form_enabled('subscribe'); |
| 604 | - if(false == $subscribe_form_id) { return; } |
|
| 604 | + if (false == $subscribe_form_id) { return; } |
|
| 605 | 605 | |
| 606 | 606 | //add Caldera Forms Fields Scripts |
| 607 | - if( defined( 'CFCORE_VER' ) ){ |
|
| 608 | - wp_enqueue_script( 'cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER ); |
|
| 607 | + if (defined('CFCORE_VER')) { |
|
| 608 | + wp_enqueue_script('cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER); |
|
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | ?> |
@@ -613,8 +613,8 @@ discard block |
||
| 613 | 613 | <div class="container"> |
| 614 | 614 | <div class="row"> |
| 615 | 615 | <div class="col-md-12"> |
| 616 | - <h2><?php esc_html_e( 'Subscribe to Our Newsletter', 'lsx' ); ?></h2> |
|
| 617 | - <?php echo do_shortcode( '[caldera_form id="'.$subscribe_form_id.'"]' ); ?> |
|
| 616 | + <h2><?php esc_html_e('Subscribe to Our Newsletter', 'lsx'); ?></h2> |
|
| 617 | + <?php echo do_shortcode('[caldera_form id="' . $subscribe_form_id . '"]'); ?> |
|
| 618 | 618 | </div> |
| 619 | 619 | </div> |
| 620 | 620 | </div> |
@@ -630,13 +630,13 @@ discard block |
||
| 630 | 630 | * @category menu |
| 631 | 631 | */ |
| 632 | 632 | function lsx_add_top_menu() { |
| 633 | - if ( has_nav_menu( 'top-menu' ) || has_nav_menu(' top-menu-left' ) ) : ?> |
|
| 633 | + if (has_nav_menu('top-menu') || has_nav_menu(' top-menu-left')) : ?> |
|
| 634 | 634 | <div id="top-menu" class="<?php lsx_top_menu_classes(); ?>"> |
| 635 | 635 | <div class="container"> |
| 636 | - <?php if ( has_nav_menu( 'top-menu' ) ) : ?> |
|
| 636 | + <?php if (has_nav_menu('top-menu')) : ?> |
|
| 637 | 637 | <nav class="top-menu"> |
| 638 | 638 | <?php |
| 639 | - wp_nav_menu( array( |
|
| 639 | + wp_nav_menu(array( |
|
| 640 | 640 | 'theme_location' => 'top-menu', |
| 641 | 641 | 'walker' => new Lsx_Bootstrap_Navwalker()) |
| 642 | 642 | ); |
@@ -644,10 +644,10 @@ discard block |
||
| 644 | 644 | </nav> |
| 645 | 645 | <?php endif; ?> |
| 646 | 646 | |
| 647 | - <?php if ( has_nav_menu( 'top-menu-left' ) ) : ?> |
|
| 647 | + <?php if (has_nav_menu('top-menu-left')) : ?> |
|
| 648 | 648 | <nav class="top-menu pull-left"> |
| 649 | 649 | <?php |
| 650 | - wp_nav_menu( array( |
|
| 650 | + wp_nav_menu(array( |
|
| 651 | 651 | 'theme_location' => 'top-menu-left', |
| 652 | 652 | 'walker' => new Lsx_Bootstrap_Navwalker()) |
| 653 | 653 | ); |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | </div> |
| 659 | 659 | <?php endif; |
| 660 | 660 | } |
| 661 | -add_action( 'lsx_header_top', 'lsx_add_top_menu' ); |
|
| 661 | +add_action('lsx_header_top', 'lsx_add_top_menu'); |
|
| 662 | 662 | |
| 663 | 663 | /** |
| 664 | 664 | * Checks if a caldera form with your slug exists |
@@ -667,24 +667,24 @@ discard block |
||
| 667 | 667 | * @subpackage template-tag |
| 668 | 668 | * @category forms |
| 669 | 669 | */ |
| 670 | -if ( class_exists('Caldera_Forms') && !function_exists( 'lsx_is_form_enabled' ) ) { |
|
| 670 | +if (class_exists('Caldera_Forms') && ! function_exists('lsx_is_form_enabled')) { |
|
| 671 | 671 | function lsx_is_form_enabled($slug = false) { |
| 672 | - if(false == $slug){ return false; } |
|
| 672 | + if (false == $slug) { return false; } |
|
| 673 | 673 | |
| 674 | 674 | $match = false; |
| 675 | - $forms = get_option( '_caldera_forms' , false ); |
|
| 676 | - if(false !== $forms ) { |
|
| 677 | - foreach($forms as $form_id=>$form_maybe){ |
|
| 678 | - if( trim(strtolower($slug)) == strtolower($form_maybe['name']) ){ |
|
| 675 | + $forms = get_option('_caldera_forms', false); |
|
| 676 | + if (false !== $forms) { |
|
| 677 | + foreach ($forms as $form_id=>$form_maybe) { |
|
| 678 | + if (trim(strtolower($slug)) == strtolower($form_maybe['name'])) { |
|
| 679 | 679 | $match = $form_id; |
| 680 | 680 | break; |
| 681 | 681 | } |
| 682 | 682 | } |
| 683 | 683 | } |
| 684 | - if( false === $match ){ |
|
| 685 | - $is_form = Caldera_Forms::get_form( strtolower( $slug ) ); |
|
| 686 | - if( !empty( $is_form ) ){ |
|
| 687 | - return strtolower( $slug ); |
|
| 684 | + if (false === $match) { |
|
| 685 | + $is_form = Caldera_Forms::get_form(strtolower($slug)); |
|
| 686 | + if ( ! empty($is_form)) { |
|
| 687 | + return strtolower($slug); |
|
| 688 | 688 | } |
| 689 | 689 | } |
| 690 | 690 | |
@@ -700,10 +700,10 @@ discard block |
||
| 700 | 700 | * @category urls |
| 701 | 701 | */ |
| 702 | 702 | function lsx_get_my_url() { |
| 703 | - if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) |
|
| 703 | + if ( ! preg_match('/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches)) |
|
| 704 | 704 | return false; |
| 705 | 705 | |
| 706 | - return esc_url_raw( $matches[1] ); |
|
| 706 | + return esc_url_raw($matches[1]); |
|
| 707 | 707 | } |
| 708 | 708 | |
| 709 | 709 | /** |
@@ -713,19 +713,19 @@ discard block |
||
| 713 | 713 | * @subpackage extras |
| 714 | 714 | * @category urls |
| 715 | 715 | */ |
| 716 | -function lsx_get_template_part($slug,$part) { |
|
| 716 | +function lsx_get_template_part($slug, $part) { |
|
| 717 | 717 | $template = array(); |
| 718 | 718 | $part = (string) $part; |
| 719 | - if ( '' !== $part ){ |
|
| 719 | + if ('' !== $part) { |
|
| 720 | 720 | $template = "{$slug}-{$part}.php"; |
| 721 | - }else{ |
|
| 721 | + } else { |
|
| 722 | 722 | $template = "{$slug}.php"; |
| 723 | 723 | } |
| 724 | - $file_path = apply_filters('lsx_content_path',false,$slug,$part); |
|
| 724 | + $file_path = apply_filters('lsx_content_path', false, $slug, $part); |
|
| 725 | 725 | |
| 726 | - if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) { |
|
| 727 | - load_template( $file_path.$template, false ); |
|
| 728 | - }else{ |
|
| 729 | - get_template_part($slug,$part); |
|
| 726 | + if (false !== $file_path && '' == locate_template(array($template)) && file_exists($file_path . $template)) { |
|
| 727 | + load_template($file_path . $template, false); |
|
| 728 | + } else { |
|
| 729 | + get_template_part($slug, $part); |
|
| 730 | 730 | } |
| 731 | 731 | } |
| 732 | 732 | \ No newline at end of file |
@@ -47,9 +47,12 @@ |
||
| 47 | 47 | |
| 48 | 48 | <?php lsx_paging_nav(); ?> |
| 49 | 49 | |
| 50 | - <?php else : ?> |
|
| 50 | + <?php else { |
|
| 51 | + : ?> |
|
| 51 | 52 | |
| 52 | - <?php get_template_part( 'content', 'none' ); ?> |
|
| 53 | + <?php get_template_part( 'content', 'none' ); |
|
| 54 | +} |
|
| 55 | +?> |
|
| 53 | 56 | |
| 54 | 57 | <?php endif; ?> |
| 55 | 58 | |
@@ -11,33 +11,33 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | <?php lsx_content_wrap_before(); ?> |
| 13 | 13 | |
| 14 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
| 14 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
| 15 | 15 | |
| 16 | 16 | <?php lsx_content_before(); ?> |
| 17 | 17 | |
| 18 | 18 | <main id="main" class="site-main"> |
| 19 | 19 | |
| 20 | 20 | <?php |
| 21 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 22 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
| 23 | - if('1c' === $layout && !is_post_type_archive('tribe_events')){ |
|
| 21 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 22 | + $layout = apply_filters('lsx_layout', $layout); |
|
| 23 | + if ('1c' === $layout && ! is_post_type_archive('tribe_events')) { |
|
| 24 | 24 | lsx_breadcrumbs(); |
| 25 | 25 | } |
| 26 | 26 | ?> |
| 27 | 27 | |
| 28 | 28 | <?php lsx_content_top(); ?> |
| 29 | 29 | |
| 30 | - <?php if ( have_posts() ) : ?> |
|
| 30 | + <?php if (have_posts()) : ?> |
|
| 31 | 31 | |
| 32 | 32 | <?php /* Start the Loop */ ?> |
| 33 | - <?php while ( have_posts() ) : the_post(); ?> |
|
| 33 | + <?php while (have_posts()) : the_post(); ?> |
|
| 34 | 34 | |
| 35 | 35 | <?php |
| 36 | 36 | /* Include the Post-Format-specific template for the content. |
| 37 | 37 | * If you want to override this in a child theme, then include a file |
| 38 | 38 | * called content-___.php (where ___ is the Post Format name) and that will be used instead. |
| 39 | 39 | */ |
| 40 | - get_template_part( 'content', get_post_format() ); |
|
| 40 | + get_template_part('content', get_post_format()); |
|
| 41 | 41 | ?> |
| 42 | 42 | |
| 43 | 43 | <?php endwhile; ?> |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | <?php else : ?> |
| 48 | 48 | |
| 49 | - <?php get_template_part( 'content', 'none' ); ?> |
|
| 49 | + <?php get_template_part('content', 'none'); ?> |
|
| 50 | 50 | |
| 51 | 51 | <?php endif; ?> |
| 52 | 52 | |
@@ -21,9 +21,9 @@ |
||
| 21 | 21 | |
| 22 | 22 | <?php lsx_content_top(); ?> |
| 23 | 23 | |
| 24 | - <?php while ( have_posts() ) : the_post(); ?> |
|
| 24 | + <?php while (have_posts()) : the_post(); ?> |
|
| 25 | 25 | |
| 26 | - <?php get_template_part( 'content', 'portfolio-single' ); ?> |
|
| 26 | + <?php get_template_part('content', 'portfolio-single'); ?> |
|
| 27 | 27 | |
| 28 | 28 | <?php endwhile; ?> |
| 29 | 29 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | if('posts' == $show_on_front && is_home()){ |
| 24 | 24 | $sidebar = 'home'; |
| 25 | - }else{ |
|
| 25 | + } else{ |
|
| 26 | 26 | $sidebar = 'sidebar-1'; |
| 27 | 27 | } |
| 28 | 28 | } |
@@ -38,9 +38,12 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary"> |
| 40 | 40 | |
| 41 | - <?php else : ?> |
|
| 41 | + <?php else { |
|
| 42 | + : ?> |
|
| 42 | 43 | |
| 43 | - <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary"> |
|
| 44 | + <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); |
|
| 45 | +} |
|
| 46 | +?>" role="complementary"> |
|
| 44 | 47 | |
| 45 | 48 | <?php endif ; ?> |
| 46 | 49 | |
@@ -6,8 +6,8 @@ discard block |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | // Allow Plugins and themes to disable the sidebar incase of very customized layouts. |
| 9 | -$sidebar_enabled = apply_filters('lsx_sidebar_enable',true); |
|
| 10 | -if(true !== $sidebar_enabled){return true;} |
|
| 9 | +$sidebar_enabled = apply_filters('lsx_sidebar_enable', true); |
|
| 10 | +if (true !== $sidebar_enabled) {return true; } |
|
| 11 | 11 | ?> |
| 12 | 12 | <?php |
| 13 | 13 | $show_on_front = get_option('show_on_front'); |
@@ -17,16 +17,16 @@ discard block |
||
| 17 | 17 | $sidebar = 'home'; |
| 18 | 18 | } else { |
| 19 | 19 | |
| 20 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 21 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
| 20 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 21 | + $layout = apply_filters('lsx_layout', $layout); |
|
| 22 | 22 | |
| 23 | - if('posts' == $show_on_front && is_home()){ |
|
| 23 | + if ('posts' == $show_on_front && is_home()) { |
|
| 24 | 24 | $sidebar = 'home'; |
| 25 | - }else{ |
|
| 25 | + } else { |
|
| 26 | 26 | $sidebar = 'sidebar-1'; |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | - if ( '1c' !== $layout ) : ?> |
|
| 29 | + if ('1c' !== $layout) : ?> |
|
| 30 | 30 | |
| 31 | 31 | <?php lsx_sidebars_before(); ?> |
| 32 | 32 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_home_sidebar_class()); ?>" role="complementary"> |
| 36 | 36 | |
| 37 | - <?php elseif ( is_page_template('page-templates/template-blog.php') ) : ?> |
|
| 37 | + <?php elseif (is_page_template('page-templates/template-blog.php')) : ?> |
|
| 38 | 38 | |
| 39 | 39 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary"> |
| 40 | 40 | |
@@ -42,25 +42,25 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary"> |
| 44 | 44 | |
| 45 | - <?php endif ; ?> |
|
| 45 | + <?php endif; ?> |
|
| 46 | 46 | |
| 47 | 47 | <?php lsx_sidebar_top(); ?> |
| 48 | 48 | |
| 49 | - <?php if ( ! dynamic_sidebar( $sidebar ) ) : ?> |
|
| 49 | + <?php if ( ! dynamic_sidebar($sidebar)) : ?> |
|
| 50 | 50 | |
| 51 | 51 | <aside id="search" class="widget widget_search"> |
| 52 | 52 | <?php get_search_form(); ?> |
| 53 | 53 | </aside> |
| 54 | 54 | |
| 55 | 55 | <aside id="archives" class="widget"> |
| 56 | - <h1 class="widget-title"><?php esc_attr_e( 'Archives', 'lsx' ); ?></h1> |
|
| 56 | + <h1 class="widget-title"><?php esc_attr_e('Archives', 'lsx'); ?></h1> |
|
| 57 | 57 | <ul> |
| 58 | - <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?> |
|
| 58 | + <?php wp_get_archives(array('type' => 'monthly')); ?> |
|
| 59 | 59 | </ul> |
| 60 | 60 | </aside> |
| 61 | 61 | |
| 62 | 62 | <aside id="meta" class="widget"> |
| 63 | - <h1 class="widget-title"><?php esc_attr_e( 'Meta', 'lsx' ); ?></h1> |
|
| 63 | + <h1 class="widget-title"><?php esc_attr_e('Meta', 'lsx'); ?></h1> |
|
| 64 | 64 | <ul> |
| 65 | 65 | <?php wp_register(); ?> |
| 66 | 66 | <li><?php wp_loginout(); ?></li> |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | $layout = get_theme_mod('lsx_layout','2cr'); |
| 13 | 13 | if('posts' == $show_on_front && is_home()){ |
| 14 | 14 | $sidebar = 'home'; |
| 15 | - }else{ |
|
| 15 | + } else{ |
|
| 16 | 16 | $sidebar = 'sidebar-1'; |
| 17 | 17 | } |
| 18 | 18 | |
@@ -9,21 +9,21 @@ |
||
| 9 | 9 | <?php |
| 10 | 10 | $show_on_front = get_option('show_on_front'); |
| 11 | 11 | |
| 12 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 13 | - if('posts' == $show_on_front && is_home()){ |
|
| 12 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 13 | + if ('posts' == $show_on_front && is_home()) { |
|
| 14 | 14 | $sidebar = 'home'; |
| 15 | - }else{ |
|
| 15 | + } else { |
|
| 16 | 16 | $sidebar = 'sidebar-1'; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - if ( '1c' !== $layout ) : ?> |
|
| 19 | + if ('1c' !== $layout) : ?> |
|
| 20 | 20 | |
| 21 | 21 | <?php lsx_sidebars_before(); ?> |
| 22 | 22 | |
| 23 | 23 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary"> |
| 24 | 24 | |
| 25 | 25 | <?php lsx_sidebar_top(); ?> |
| 26 | - <h2><?php esc_attr_e( 'Categories', 'lsx' ); ?></h2> |
|
| 26 | + <h2><?php esc_attr_e('Categories', 'lsx'); ?></h2> |
|
| 27 | 27 | <aside id="categories" class="widget widget_categories"> |
| 28 | 28 | <?php echo wp_tag_cloud(array('taxonomy'=>'category')); ?> |
| 29 | 29 | </aside> |
@@ -13,9 +13,9 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | <?php lsx_content_top(); ?> |
| 15 | 15 | |
| 16 | - <?php if(have_posts() && !class_exists('Lsx_Banners')) : ?> |
|
| 16 | + <?php if (have_posts() && ! class_exists('Lsx_Banners')) : ?> |
|
| 17 | 17 | |
| 18 | - <?php while ( have_posts() ) : the_post(); ?> |
|
| 18 | + <?php while (have_posts()) : the_post(); ?> |
|
| 19 | 19 | |
| 20 | 20 | <?php lsx_entry_before(); ?> |
| 21 | 21 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | <div id="home-widgets"> |
| 38 | 38 | |
| 39 | - <?php if ( ! dynamic_sidebar( 'sidebar-home' ) ) : ?> |
|
| 39 | + <?php if ( ! dynamic_sidebar('sidebar-home')) : ?> |
|
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | <?php endif; // end sidebar widget area ?> |