@@ -198,6 +198,7 @@ discard block |
||
| 198 | 198 | * @package lsx |
| 199 | 199 | * @subpackage extras |
| 200 | 200 | * @category thumbnails |
| 201 | + * @param string $size |
|
| 201 | 202 | */ |
| 202 | 203 | function lsx_get_thumbnail($size,$image_src = false){ |
| 203 | 204 | |
@@ -252,6 +253,7 @@ discard block |
||
| 252 | 253 | * @package lsx |
| 253 | 254 | * @subpackage extras |
| 254 | 255 | * @category thumbnails |
| 256 | + * @param boolean $image_src |
|
| 255 | 257 | */ |
| 256 | 258 | function lsx_get_attachment_id_from_src($image_src) { |
| 257 | 259 | global $wpdb; |
@@ -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 | * Add and remove body_class() classes |
@@ -204,10 +207,10 @@ discard block |
||
| 204 | 207 | if(false === $image_src){ |
| 205 | 208 | $post_id = get_the_ID(); |
| 206 | 209 | $post_thumbnail_id = get_post_thumbnail_id( $post_id ); |
| 207 | - }elseif(false != $image_src ){ |
|
| 210 | + } elseif(false != $image_src ){ |
|
| 208 | 211 | if(is_numeric($image_src)){ |
| 209 | 212 | $post_thumbnail_id = $image_src; |
| 210 | - }else{ |
|
| 213 | + } else{ |
|
| 211 | 214 | $post_thumbnail_id = lsx_get_attachment_id_from_src($image_src); |
| 212 | 215 | } |
| 213 | 216 | } |
@@ -217,7 +220,7 @@ discard block |
||
| 217 | 220 | $srcset = false; |
| 218 | 221 | $img = wp_get_attachment_image_src($post_thumbnail_id,$size); |
| 219 | 222 | $img = $img[0]; |
| 220 | - }else{ |
|
| 223 | + } else{ |
|
| 221 | 224 | $srcset = true; |
| 222 | 225 | $img = wp_get_attachment_image_srcset($post_thumbnail_id,$size); |
| 223 | 226 | if($img == false) { |
@@ -327,18 +330,29 @@ discard block |
||
| 327 | 330 | */ |
| 328 | 331 | function mv_browser_body_class($classes) { |
| 329 | 332 | global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone; |
| 330 | - if($is_lynx) $classes[] = 'lynx'; |
|
| 331 | - elseif($is_gecko) $classes[] = 'gecko'; |
|
| 332 | - elseif($is_opera) $classes[] = 'opera'; |
|
| 333 | - elseif($is_NS4) $classes[] = 'ns4'; |
|
| 334 | - elseif($is_safari) $classes[] = 'safari'; |
|
| 335 | - elseif($is_chrome) $classes[] = 'chrome'; |
|
| 336 | - elseif($is_IE) { |
|
| 333 | + if($is_lynx) { |
|
| 334 | + $classes[] = 'lynx'; |
|
| 335 | + } elseif($is_gecko) { |
|
| 336 | + $classes[] = 'gecko'; |
|
| 337 | + } elseif($is_opera) { |
|
| 338 | + $classes[] = 'opera'; |
|
| 339 | + } elseif($is_NS4) { |
|
| 340 | + $classes[] = 'ns4'; |
|
| 341 | + } elseif($is_safari) { |
|
| 342 | + $classes[] = 'safari'; |
|
| 343 | + } elseif($is_chrome) { |
|
| 344 | + $classes[] = 'chrome'; |
|
| 345 | + } elseif($is_IE) { |
|
| 337 | 346 | $classes[] = 'ie'; |
| 338 | - if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $_SERVER['HTTP_USER_AGENT'], $browser_version)) |
|
| 339 | - $classes[] = 'ie'.$browser_version[1]; |
|
| 340 | - } else $classes[] = 'unknown'; |
|
| 341 | - if($is_iphone) $classes[] = 'iphone'; |
|
| 347 | + if(preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $_SERVER['HTTP_USER_AGENT'], $browser_version)) { |
|
| 348 | + $classes[] = 'ie'.$browser_version[1]; |
|
| 349 | + } |
|
| 350 | + } else { |
|
| 351 | + $classes[] = 'unknown'; |
|
| 352 | + } |
|
| 353 | + if($is_iphone) { |
|
| 354 | + $classes[] = 'iphone'; |
|
| 355 | + } |
|
| 342 | 356 | if ( stristr( $_SERVER['HTTP_USER_AGENT'],"mac") ) { |
| 343 | 357 | $classes[] = 'osx'; |
| 344 | 358 | } elseif ( stristr( $_SERVER['HTTP_USER_AGENT'],"linux") ) { |
@@ -396,8 +410,7 @@ discard block |
||
| 396 | 410 | |
| 397 | 411 | if ( ! empty( $pagination ) ) { |
| 398 | 412 | $excerpt .= $pagination; |
| 399 | - } |
|
| 400 | - else { |
|
| 413 | + } else { |
|
| 401 | 414 | $excerpt .= '<p><a class="moretag" href="'.get_permalink().'">'.__('Continue reading','lsx').'</a></p>'; |
| 402 | 415 | } |
| 403 | 416 | } |
@@ -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 | |
@@ -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; |
@@ -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 ) { |
@@ -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. |
@@ -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 | |
@@ -272,9 +275,9 @@ discard block |
||
| 272 | 275 | |
| 273 | 276 | if(current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')){ |
| 274 | 277 | return true; |
| 275 | - }elseif(function_exists('wp_pagenavi')){ |
|
| 278 | + } elseif(function_exists('wp_pagenavi')){ |
|
| 276 | 279 | wp_pagenavi(); |
| 277 | - }else{ |
|
| 280 | + } else{ |
|
| 278 | 281 | |
| 279 | 282 | $labels = array( |
| 280 | 283 | 'next' => '<span class="meta-nav">←</span> '.__( 'Older posts', 'lsx' ), |
@@ -354,9 +357,9 @@ discard block |
||
| 354 | 357 | |
| 355 | 358 | if ( function_exists('has_custom_logo') && has_custom_logo() ) { |
| 356 | 359 | the_custom_logo(); |
| 357 | - }elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { |
|
| 360 | + } elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { |
|
| 358 | 361 | jetpack_the_site_logo(); |
| 359 | - }else{ |
|
| 362 | + } else{ |
|
| 360 | 363 | // shouldn't show both together.. its just strange |
| 361 | 364 | if(true == get_theme_mod('site_logo_header_text',1)){ |
| 362 | 365 | lsx_site_title(); |
@@ -498,7 +501,7 @@ discard block |
||
| 498 | 501 | $post_type_object = get_post_type_object($post_type); |
| 499 | 502 | if(null != $post_type_object){ |
| 500 | 503 | $title = $post_type_object->labels->name; |
| 501 | - }else{ |
|
| 504 | + } else{ |
|
| 502 | 505 | $title = ucwords($post_type); |
| 503 | 506 | } |
| 504 | 507 | |
@@ -640,8 +643,9 @@ discard block |
||
| 640 | 643 | * @category urls |
| 641 | 644 | */ |
| 642 | 645 | function lsx_get_my_url() { |
| 643 | - if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) |
|
| 644 | - return false; |
|
| 646 | + if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) { |
|
| 647 | + return false; |
|
| 648 | + } |
|
| 645 | 649 | |
| 646 | 650 | return esc_url_raw( $matches[1] ); |
| 647 | 651 | } |
@@ -658,14 +662,14 @@ discard block |
||
| 658 | 662 | $part = (string) $part; |
| 659 | 663 | if ( '' !== $part ){ |
| 660 | 664 | $template = "{$slug}-{$part}.php"; |
| 661 | - }else{ |
|
| 665 | + } else{ |
|
| 662 | 666 | $template = "{$slug}.php"; |
| 663 | 667 | } |
| 664 | 668 | $file_path = apply_filters('lsx_content_path',false,$slug,$part); |
| 665 | 669 | |
| 666 | 670 | if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) { |
| 667 | 671 | load_template( $file_path.$template, false ); |
| 668 | - }else{ |
|
| 672 | + } else{ |
|
| 669 | 673 | get_template_part($slug,$part); |
| 670 | 674 | } |
| 671 | 675 | } |
| 672 | 676 | \ No newline at end of file |
@@ -30,7 +30,6 @@ |
||
| 30 | 30 | * @param string $output Passed by reference. Used to append additional content. |
| 31 | 31 | * @param object $item Menu item data object. |
| 32 | 32 | * @param int $depth Depth of menu item. Used for padding. |
| 33 | - * @param int $current_page Menu item ID. |
|
| 34 | 33 | * @param object $args |
| 35 | 34 | */ |
| 36 | 35 | public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { |
@@ -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 | class lsx_bootstrap_navwalker extends Walker_Nav_Menu { |
| 5 | 8 | |
@@ -71,14 +74,17 @@ discard block |
||
| 71 | 74 | |
| 72 | 75 | $class_names = join( ' ', $classes ); |
| 73 | 76 | |
| 74 | - if ( $args->has_children ) |
|
| 75 | - $class_names .= ' dropdown'; |
|
| 77 | + if ( $args->has_children ) { |
|
| 78 | + $class_names .= ' dropdown'; |
|
| 79 | + } |
|
| 76 | 80 | |
| 77 | - if ( in_array( 'current-menu-item', $classes ) ) |
|
| 78 | - $class_names .= ' active'; |
|
| 81 | + if ( in_array( 'current-menu-item', $classes ) ) { |
|
| 82 | + $class_names .= ' active'; |
|
| 83 | + } |
|
| 79 | 84 | |
| 80 | - if ( in_array( 'current-menu-parent', $classes ) ) |
|
| 81 | - $class_names .= ' active'; |
|
| 85 | + if ( in_array( 'current-menu-parent', $classes ) ) { |
|
| 86 | + $class_names .= ' active'; |
|
| 87 | + } |
|
| 82 | 88 | |
| 83 | 89 | //Check if this is ment to be a "social" type menu |
| 84 | 90 | $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; |
@@ -159,14 +165,16 @@ discard block |
||
| 159 | 165 | * @return null Null on failure with no changes to parameters. |
| 160 | 166 | */ |
| 161 | 167 | public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) { |
| 162 | - if ( ! $element ) |
|
| 163 | - return; |
|
| 168 | + if ( ! $element ) { |
|
| 169 | + return; |
|
| 170 | + } |
|
| 164 | 171 | |
| 165 | 172 | $id_field = $this->db_fields['id']; |
| 166 | 173 | |
| 167 | 174 | // Display this element. |
| 168 | - if ( is_object( $args[0] ) ) |
|
| 169 | - $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] ); |
|
| 175 | + if ( is_object( $args[0] ) ) { |
|
| 176 | + $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] ); |
|
| 177 | + } |
|
| 170 | 178 | |
| 171 | 179 | parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); |
| 172 | 180 | } |
@@ -192,29 +200,34 @@ discard block |
||
| 192 | 200 | if ( $container ) { |
| 193 | 201 | $fb_output = '<' . $container; |
| 194 | 202 | |
| 195 | - if ( $container_id ) |
|
| 196 | - $fb_output .= ' id="' . $container_id . '"'; |
|
| 203 | + if ( $container_id ) { |
|
| 204 | + $fb_output .= ' id="' . $container_id . '"'; |
|
| 205 | + } |
|
| 197 | 206 | |
| 198 | - if ( $container_class ) |
|
| 199 | - $fb_output .= ' class="' . $container_class . '"'; |
|
| 207 | + if ( $container_class ) { |
|
| 208 | + $fb_output .= ' class="' . $container_class . '"'; |
|
| 209 | + } |
|
| 200 | 210 | |
| 201 | 211 | $fb_output .= '>'; |
| 202 | 212 | } |
| 203 | 213 | |
| 204 | 214 | $fb_output .= '<ul'; |
| 205 | 215 | |
| 206 | - if ( $menu_id ) |
|
| 207 | - $fb_output .= ' id="' . $menu_id . '"'; |
|
| 216 | + if ( $menu_id ) { |
|
| 217 | + $fb_output .= ' id="' . $menu_id . '"'; |
|
| 218 | + } |
|
| 208 | 219 | |
| 209 | - if ( $menu_class ) |
|
| 210 | - $fb_output .= ' class="' . $menu_class . '"'; |
|
| 220 | + if ( $menu_class ) { |
|
| 221 | + $fb_output .= ' class="' . $menu_class . '"'; |
|
| 222 | + } |
|
| 211 | 223 | |
| 212 | 224 | $fb_output .= '>'; |
| 213 | 225 | $fb_output .= '<li><a href="' . admin_url( 'nav-menus.php' ) . '">'.__('Add a menu','lsx').'</a></li>'; |
| 214 | 226 | $fb_output .= '</ul>'; |
| 215 | 227 | |
| 216 | - if ( $container ) |
|
| 217 | - $fb_output .= '</' . $container . '>'; |
|
| 228 | + if ( $container ) { |
|
| 229 | + $fb_output .= '</' . $container . '>'; |
|
| 230 | + } |
|
| 218 | 231 | |
| 219 | 232 | echo $fb_output; |
| 220 | 233 | } |
@@ -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 | |
@@ -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 | |
@@ -33,8 +33,10 @@ discard block |
||
| 33 | 33 | $paged = get_query_var( 'paged' ); |
| 34 | 34 | elseif ( get_query_var( 'page' ) ) : |
| 35 | 35 | $paged = get_query_var( 'page' ); |
| 36 | - else : |
|
| 36 | + else { |
|
| 37 | + : |
|
| 37 | 38 | $paged = 1; |
| 39 | + } |
|
| 38 | 40 | endif; |
| 39 | 41 | |
| 40 | 42 | $args = array( |
@@ -59,11 +61,14 @@ discard block |
||
| 59 | 61 | </div> |
| 60 | 62 | </div><!-- .portfolio-wrapper --> |
| 61 | 63 | |
| 62 | - <?php else : ?> |
|
| 64 | + <?php else { |
|
| 65 | + : ?> |
|
| 63 | 66 | |
| 64 | 67 | <section class="no-results not-found"> |
| 65 | 68 | <header class="page-header"> |
| 66 | - <h1 class="page-title"><?php _e( 'Nothing Found', 'lsx' ); ?></h1> |
|
| 69 | + <h1 class="page-title"><?php _e( 'Nothing Found', 'lsx' ); |
|
| 70 | +} |
|
| 71 | +?></h1> |
|
| 67 | 72 | </header><!-- .page-header --> |
| 68 | 73 | |
| 69 | 74 | <div class="page-content"> |
@@ -71,9 +76,12 @@ discard block |
||
| 71 | 76 | |
| 72 | 77 | <p><?php printf( __( 'Ready to publish your first project? <a href="%1$s">Get started here</a>.', 'lsx' ), esc_url( admin_url( 'post-new.php?post_type=jetpack-portfolio' ) ) ); ?></p> |
| 73 | 78 | |
| 74 | - <?php else : ?> |
|
| 79 | + <?php else { |
|
| 80 | + : ?> |
|
| 75 | 81 | |
| 76 | - <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'lsx' ); ?></p> |
|
| 82 | + <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'lsx' ); |
|
| 83 | +} |
|
| 84 | +?></p> |
|
| 77 | 85 | <?php get_search_form(); ?> |
| 78 | 86 | |
| 79 | 87 | <?php endif; ?> |