@@ -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 | 47 | echo $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,69 +99,69 @@ 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 | - _x( 'Posted on:', 'Used before publish date.', 'lsx' ), |
|
| 115 | - esc_url( get_permalink() ), |
|
| 113 | + printf('<span class="post-meta-time"><span>%1$s</span> <a href="%2$s" rel="bookmark">%3$s</a></span>', |
|
| 114 | + _x('Posted on:', 'Used before publish date.', 'lsx'), |
|
| 115 | + esc_url(get_permalink()), |
|
| 116 | 116 | $time_string |
| 117 | 117 | ); |
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_date', 10 ); |
|
| 120 | +add_action('lsx_content_post_meta', 'lsx_post_meta_date', 10); |
|
| 121 | 121 | |
| 122 | 122 | /** |
| 123 | 123 | * Add customisable post meta: post author |
| 124 | 124 | */ |
| 125 | -if ( ! function_exists( 'lsx_post_meta_author' ) ) { |
|
| 125 | +if ( ! function_exists('lsx_post_meta_author')) { |
|
| 126 | 126 | function lsx_post_meta_author() { |
| 127 | - printf( '<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>', |
|
| 128 | - _x( 'Posted by:', 'Used before post author name.', 'lsx' ), |
|
| 129 | - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), |
|
| 127 | + printf('<span class="post-meta-author"><span>%1$s</span> <a href="%2$s">%3$s</a></span>', |
|
| 128 | + _x('Posted by:', 'Used before post author name.', 'lsx'), |
|
| 129 | + esc_url(get_author_posts_url(get_the_author_meta('ID'))), |
|
| 130 | 130 | get_the_author() |
| 131 | 131 | ); |
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_author', 20 ); |
|
| 134 | +add_action('lsx_content_post_meta', 'lsx_post_meta_author', 20); |
|
| 135 | 135 | |
| 136 | 136 | /** |
| 137 | 137 | * Add customisable post meta: post category(ies) |
| 138 | 138 | */ |
| 139 | -if ( ! function_exists( 'lsx_post_meta_category' ) ) { |
|
| 139 | +if ( ! function_exists('lsx_post_meta_category')) { |
|
| 140 | 140 | function lsx_post_meta_category() { |
| 141 | - $post_categories = wp_get_post_categories( get_the_ID() ); |
|
| 141 | + $post_categories = wp_get_post_categories(get_the_ID()); |
|
| 142 | 142 | $cats = array(); |
| 143 | 143 | |
| 144 | - foreach( $post_categories as $c ) { |
|
| 145 | - $cat = get_category( $c ); |
|
| 146 | - $cats[] = '<a href="' . get_category_link( $cat->term_id ) . '" title="' . sprintf( esc_html__( 'View all posts in %s' , 'lsx' ), $cat->name ) . '" ' . '>' . $cat->name . '</a>'; |
|
| 144 | + foreach ($post_categories as $c) { |
|
| 145 | + $cat = get_category($c); |
|
| 146 | + $cats[] = '<a href="' . get_category_link($cat->term_id) . '" title="' . sprintf(esc_html__('View all posts in %s', 'lsx'), $cat->name) . '" ' . '>' . $cat->name . '</a>'; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - if ( ! empty( $cats ) ) { |
|
| 149 | + if ( ! empty($cats)) { |
|
| 150 | 150 | ?> |
| 151 | - <span class="post-meta-categories"><span><?php esc_html_e( 'Posted in:', 'lsx' ); ?></span> <?php echo implode( ', ', $cats ); ?></span> |
|
| 151 | + <span class="post-meta-categories"><span><?php esc_html_e('Posted in:', 'lsx'); ?></span> <?php echo implode(', ', $cats); ?></span> |
|
| 152 | 152 | <?php |
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | -add_action( 'lsx_content_post_meta', 'lsx_post_meta_category', 30 ); |
|
| 156 | +add_action('lsx_content_post_meta', 'lsx_post_meta_category', 30); |
|
| 157 | 157 | |
| 158 | 158 | /** |
| 159 | 159 | * Translate post format to Font Awesome class |
| 160 | 160 | */ |
| 161 | 161 | |
| 162 | -if ( ! function_exists( 'lsx_translate_format_to_fontawesome' ) ) { |
|
| 163 | - function lsx_translate_format_to_fontawesome( $format ) { |
|
| 164 | - switch ( $format ) { |
|
| 162 | +if ( ! function_exists('lsx_translate_format_to_fontawesome')) { |
|
| 163 | + function lsx_translate_format_to_fontawesome($format) { |
|
| 164 | + switch ($format) { |
|
| 165 | 165 | case 'image': |
| 166 | 166 | $format = 'camera'; |
| 167 | 167 | break; |
@@ -206,44 +206,44 @@ discard block |
||
| 206 | 206 | * to be added/modified where necessary. |
| 207 | 207 | */ |
| 208 | 208 | |
| 209 | -if ( ! function_exists( 'lsx_portfolio_meta' ) ) { |
|
| 209 | +if ( ! function_exists('lsx_portfolio_meta')) { |
|
| 210 | 210 | function lsx_portfolio_meta() { |
| 211 | 211 | ?> |
| 212 | 212 | <div id="portfolio-meta" class="portfolio-meta info-box-sticky info-box sticky-wrapper"> |
| 213 | 213 | <?php |
| 214 | - $client = get_post_meta(get_the_ID(),'lsx-client',true); |
|
| 215 | - if(false != $client){ ?> |
|
| 214 | + $client = get_post_meta(get_the_ID(), 'lsx-client', true); |
|
| 215 | + if (false != $client) { ?> |
|
| 216 | 216 | <div class="portfolio-client"> |
| 217 | - <span><span class="fa fa-user"></span><?php _e('Client','lsx'); ?></span> |
|
| 217 | + <span><span class="fa fa-user"></span><?php _e('Client', 'lsx'); ?></span> |
|
| 218 | 218 | <span><?php echo $client ?></span> |
| 219 | 219 | </div> |
| 220 | 220 | <?php } ?> |
| 221 | 221 | |
| 222 | 222 | <?php |
| 223 | - $portfolio_type = get_the_term_list( get_the_ID(), 'jetpack-portfolio-type', '', ', ', '' ); |
|
| 223 | + $portfolio_type = get_the_term_list(get_the_ID(), 'jetpack-portfolio-type', '', ', ', ''); |
|
| 224 | 224 | |
| 225 | - if($portfolio_type){ |
|
| 225 | + if ($portfolio_type) { |
|
| 226 | 226 | ?> |
| 227 | 227 | <div class="portfolio-industry"> |
| 228 | - <span><span class="fa fa-folder-open"></span><?php _e('Industry','lsx'); ?></span> |
|
| 228 | + <span><span class="fa fa-folder-open"></span><?php _e('Industry', 'lsx'); ?></span> |
|
| 229 | 229 | <?php echo $portfolio_type; ?> |
| 230 | 230 | </div> |
| 231 | 231 | <?php } ?> |
| 232 | 232 | |
| 233 | 233 | <?php |
| 234 | - $services = get_the_term_list( get_the_ID(), 'jetpack-portfolio-tag', '', ', ', '' ); |
|
| 235 | - if(false != $services){ ?> |
|
| 234 | + $services = get_the_term_list(get_the_ID(), 'jetpack-portfolio-tag', '', ', ', ''); |
|
| 235 | + if (false != $services) { ?> |
|
| 236 | 236 | <div class="portfolio-services"> |
| 237 | - <span><span class="fa fa-cog"></span><?php _e('Services','lsx'); ?></span> |
|
| 237 | + <span><span class="fa fa-cog"></span><?php _e('Services', 'lsx'); ?></span> |
|
| 238 | 238 | <?php echo $services ?> |
| 239 | 239 | </div> |
| 240 | 240 | <?php } ?> |
| 241 | 241 | |
| 242 | 242 | <?php |
| 243 | - $website = esc_url( get_post_meta(get_the_ID(),'lsx-website',true) ); |
|
| 244 | - if(false != $website){ ?> |
|
| 243 | + $website = esc_url(get_post_meta(get_the_ID(), 'lsx-website', true)); |
|
| 244 | + if (false != $website) { ?> |
|
| 245 | 245 | <div class="portfolio-website"> |
| 246 | - <span><span class="fa fa-link"></span><?php _e('Website','lsx'); ?></span> |
|
| 246 | + <span><span class="fa fa-link"></span><?php _e('Website', 'lsx'); ?></span> |
|
| 247 | 247 | <a target="_blank" href="<?php echo esc_url($website); ?>"><?php echo $website ?></a> |
| 248 | 248 | </div> |
| 249 | 249 | <?php } ?> |
@@ -258,29 +258,29 @@ discard block |
||
| 258 | 258 | * |
| 259 | 259 | */ |
| 260 | 260 | |
| 261 | -if ( ! function_exists( 'lsx_portfolio_gallery' ) ) { |
|
| 261 | +if ( ! function_exists('lsx_portfolio_gallery')) { |
|
| 262 | 262 | function lsx_portfolio_gallery() { |
| 263 | 263 | |
| 264 | - $media = get_attached_media( 'image' ); |
|
| 264 | + $media = get_attached_media('image'); |
|
| 265 | 265 | $media_array = array(); |
| 266 | 266 | $post_thumbnail_id = get_post_thumbnail_id(get_the_ID()); |
| 267 | 267 | |
| 268 | - if(!empty($media)){ |
|
| 269 | - foreach($media as $media_item){ |
|
| 270 | - if($post_thumbnail_id != $media_item->ID) { |
|
| 268 | + if ( ! empty($media)) { |
|
| 269 | + foreach ($media as $media_item) { |
|
| 270 | + if ($post_thumbnail_id != $media_item->ID) { |
|
| 271 | 271 | $media_array[] = $media_item->ID; |
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | - if(!empty($media_array)){ |
|
| 276 | - echo gallery_shortcode(array('size'=>'full','ids'=>implode(',', $media_array))); |
|
| 275 | + if ( ! empty($media_array)) { |
|
| 276 | + echo gallery_shortcode(array('size'=>'full', 'ids'=>implode(',', $media_array))); |
|
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | } |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | -if ( ! function_exists( 'lsx_paging_nav' ) ) : |
|
| 283 | +if ( ! function_exists('lsx_paging_nav')) : |
|
| 284 | 284 | /** |
| 285 | 285 | * Display navigation to next/previous set of posts when applicable. |
| 286 | 286 | * |
@@ -288,22 +288,22 @@ discard block |
||
| 288 | 288 | */ |
| 289 | 289 | function lsx_paging_nav() { |
| 290 | 290 | // Don't print empty markup if there's only one page. |
| 291 | - if ( $GLOBALS['wp_query']->max_num_pages < 2 ) { |
|
| 291 | + if ($GLOBALS['wp_query']->max_num_pages < 2) { |
|
| 292 | 292 | return; |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | - if(current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')){ |
|
| 295 | + if (current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')) { |
|
| 296 | 296 | return true; |
| 297 | - }elseif(function_exists('wp_pagenavi')){ |
|
| 297 | + }elseif (function_exists('wp_pagenavi')) { |
|
| 298 | 298 | wp_pagenavi(); |
| 299 | - }else{ |
|
| 299 | + } else { |
|
| 300 | 300 | |
| 301 | 301 | $labels = array( |
| 302 | - 'next' => '<span class="meta-nav">←</span> '.__( 'Older posts', 'lsx' ), |
|
| 303 | - 'previous' => __( 'Newer posts', 'lsx' ).' <span class="meta-nav">→</span>', |
|
| 304 | - 'title' => __( 'Posts navigation', 'lsx' ) |
|
| 302 | + 'next' => '<span class="meta-nav">←</span> ' . __('Older posts', 'lsx'), |
|
| 303 | + 'previous' => __('Newer posts', 'lsx') . ' <span class="meta-nav">→</span>', |
|
| 304 | + 'title' => __('Posts navigation', 'lsx') |
|
| 305 | 305 | ); |
| 306 | - $labels = apply_filters('lsx_post_navigation_labels',$labels); |
|
| 306 | + $labels = apply_filters('lsx_post_navigation_labels', $labels); |
|
| 307 | 307 | |
| 308 | 308 | extract($labels); |
| 309 | 309 | ?> |
@@ -311,12 +311,12 @@ discard block |
||
| 311 | 311 | <div class="lsx-breaker"></div> |
| 312 | 312 | <h1 class="screen-reader-text"><?php echo $title; ?></h1> |
| 313 | 313 | <div class="nav-links"> |
| 314 | - <?php if ( get_next_posts_link() ) : ?> |
|
| 315 | - <div class="nav-previous"><?php next_posts_link( $next ); ?></div> |
|
| 314 | + <?php if (get_next_posts_link()) : ?> |
|
| 315 | + <div class="nav-previous"><?php next_posts_link($next); ?></div> |
|
| 316 | 316 | <?php endif; ?> |
| 317 | 317 | |
| 318 | - <?php if ( get_previous_posts_link() ) : ?> |
|
| 319 | - <div class="nav-next"><?php previous_posts_link( $previous ); ?></div> |
|
| 318 | + <?php if (get_previous_posts_link()) : ?> |
|
| 319 | + <div class="nav-next"><?php previous_posts_link($previous); ?></div> |
|
| 320 | 320 | <?php endif; ?> |
| 321 | 321 | |
| 322 | 322 | <div class="clearfix"></div> |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | } |
| 328 | 328 | endif; |
| 329 | 329 | |
| 330 | -if ( ! function_exists( 'lsx_post_nav' ) ) : |
|
| 330 | +if ( ! function_exists('lsx_post_nav')) : |
|
| 331 | 331 | /** |
| 332 | 332 | * Display navigation to next/previous post when applicable. |
| 333 | 333 | * |
@@ -335,10 +335,10 @@ discard block |
||
| 335 | 335 | */ |
| 336 | 336 | function lsx_post_nav() { |
| 337 | 337 | // Don't print empty markup if there's nowhere to navigate. |
| 338 | - $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); |
|
| 339 | - $next = get_adjacent_post( false, '', false ); |
|
| 338 | + $previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true); |
|
| 339 | + $next = get_adjacent_post(false, '', false); |
|
| 340 | 340 | |
| 341 | - if ( ! $next && ! $previous ) { |
|
| 341 | + if ( ! $next && ! $previous) { |
|
| 342 | 342 | return; |
| 343 | 343 | } |
| 344 | 344 | ?> |
@@ -348,13 +348,13 @@ discard block |
||
| 348 | 348 | <div class="nav-links pager row"> |
| 349 | 349 | |
| 350 | 350 | <?php |
| 351 | - $previous_post = get_previous_post_link( '%link', '<div class="previous col-md-6"><p class="nav-links-description">'._x( 'Previous Post', 'Previous post link', 'lsx' ).'</p><h3>%title</h3></div>' ); |
|
| 352 | - $previous_post = str_replace('<a','<a',$previous_post); |
|
| 351 | + $previous_post = get_previous_post_link('%link', '<div class="previous col-md-6"><p class="nav-links-description">' . _x('Previous Post', 'Previous post link', 'lsx') . '</p><h3>%title</h3></div>'); |
|
| 352 | + $previous_post = str_replace('<a', '<a', $previous_post); |
|
| 353 | 353 | echo $previous_post; |
| 354 | 354 | ?> |
| 355 | 355 | <?php |
| 356 | - $next_post = get_next_post_link( '%link', '<div class="next col-md-6"><p class="nav-links-description">'._x( 'Next Post', 'Next post link', 'lsx' ).'</p><h3>%title</h3></div>' ); |
|
| 357 | - $next_post = str_replace('<a','<a',$next_post); |
|
| 356 | + $next_post = get_next_post_link('%link', '<div class="next col-md-6"><p class="nav-links-description">' . _x('Next Post', 'Next post link', 'lsx') . '</p><h3>%title</h3></div>'); |
|
| 357 | + $next_post = str_replace('<a', '<a', $next_post); |
|
| 358 | 358 | echo $next_post; |
| 359 | 359 | ?> |
| 360 | 360 | |
@@ -371,16 +371,16 @@ discard block |
||
| 371 | 371 | * @subpackage template-tags |
| 372 | 372 | * @category header |
| 373 | 373 | */ |
| 374 | -if(!function_exists('lsx_site_identity')){ |
|
| 375 | - function lsx_site_identity(){ |
|
| 374 | +if ( ! function_exists('lsx_site_identity')) { |
|
| 375 | + function lsx_site_identity() { |
|
| 376 | 376 | |
| 377 | - if ( function_exists('has_custom_logo') && has_custom_logo() ) { |
|
| 377 | + if (function_exists('has_custom_logo') && has_custom_logo()) { |
|
| 378 | 378 | the_custom_logo(); |
| 379 | - }elseif ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { |
|
| 379 | + }elseif (function_exists('jetpack_has_site_logo') && jetpack_has_site_logo()) { |
|
| 380 | 380 | jetpack_the_site_logo(); |
| 381 | - }else{ |
|
| 381 | + } else { |
|
| 382 | 382 | // shouldn't show both together.. its just strange |
| 383 | - if(true == get_theme_mod('site_logo_header_text',1)){ |
|
| 383 | + if (true == get_theme_mod('site_logo_header_text', 1)) { |
|
| 384 | 384 | lsx_site_title(); |
| 385 | 385 | } |
| 386 | 386 | } |
@@ -395,17 +395,17 @@ discard block |
||
| 395 | 395 | * @subpackage template-tags |
| 396 | 396 | * @category navigation |
| 397 | 397 | */ |
| 398 | -if(!function_exists('lsx_navbar_header')){ |
|
| 399 | - function lsx_navbar_header(){ ?> |
|
| 398 | +if ( ! function_exists('lsx_navbar_header')) { |
|
| 399 | + function lsx_navbar_header() { ?> |
|
| 400 | 400 | <div class="navbar-header" itemscope itemtype="http://schema.org/WebPage"> |
| 401 | 401 | |
| 402 | 402 | <?php |
| 403 | - $nav_menu = get_theme_mod('nav_menu_locations',false); |
|
| 403 | + $nav_menu = get_theme_mod('nav_menu_locations', false); |
|
| 404 | 404 | //print_r(get_nav_menu_locations()); |
| 405 | 405 | |
| 406 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
| 406 | + if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?> |
|
| 407 | 407 | <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".primary-navbar"> |
| 408 | - <span class="sr-only"><?php _e('Toggle navigation','lsx'); ?></span> |
|
| 408 | + <span class="sr-only"><?php _e('Toggle navigation', 'lsx'); ?></span> |
|
| 409 | 409 | <span class="icon-bar"></span> |
| 410 | 410 | <span class="icon-bar"></span> |
| 411 | 411 | <span class="icon-bar"></span> |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | <?php } |
| 418 | 418 | } |
| 419 | 419 | //the if statement is for backwards compatability with previous versions of the theme. |
| 420 | -add_action('lsx_nav_before','lsx_navbar_header'); |
|
| 420 | +add_action('lsx_nav_before', 'lsx_navbar_header'); |
|
| 421 | 421 | |
| 422 | 422 | /** |
| 423 | 423 | * Outputs the Nav Menu |
@@ -426,16 +426,16 @@ discard block |
||
| 426 | 426 | * @subpackage template-tags |
| 427 | 427 | * @category navigation |
| 428 | 428 | */ |
| 429 | -if(!function_exists('lsx_nav_menu')){ |
|
| 430 | - function lsx_nav_menu(){ |
|
| 431 | - $nav_menu = get_theme_mod('nav_menu_locations',false); |
|
| 429 | +if ( ! function_exists('lsx_nav_menu')) { |
|
| 430 | + function lsx_nav_menu() { |
|
| 431 | + $nav_menu = get_theme_mod('nav_menu_locations', false); |
|
| 432 | 432 | |
| 433 | 433 | //print_r(get_nav_menu_locations()); |
| 434 | 434 | |
| 435 | - if(false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']){ ?> |
|
| 435 | + if (false != $nav_menu && isset($nav_menu['primary']) && 0 != $nav_menu['primary']) { ?> |
|
| 436 | 436 | <nav class="primary-navbar collapse navbar-collapse"> |
| 437 | 437 | <?php |
| 438 | - wp_nav_menu( array( |
|
| 438 | + wp_nav_menu(array( |
|
| 439 | 439 | 'theme_location' => 'primary', |
| 440 | 440 | 'menu' => $nav_menu['primary'], |
| 441 | 441 | 'depth' => 3, |
@@ -445,9 +445,9 @@ discard block |
||
| 445 | 445 | ); |
| 446 | 446 | ?> |
| 447 | 447 | </nav> |
| 448 | - <?php } elseif(is_customize_preview()) { ?> |
|
| 448 | + <?php } elseif (is_customize_preview()) { ?> |
|
| 449 | 449 | <nav class="primary-navbar collapse navbar-collapse"> |
| 450 | - <div class="alert alert-info" role="alert"><?php _e('Create a menu and assign it here via the "Navigation" panel.','lsx');?></div> |
|
| 450 | + <div class="alert alert-info" role="alert"><?php _e('Create a menu and assign it here via the "Navigation" panel.', 'lsx'); ?></div> |
|
| 451 | 451 | </nav> |
| 452 | 452 | </div> |
| 453 | 453 | <?php } |
@@ -461,9 +461,9 @@ discard block |
||
| 461 | 461 | * @subpackage template-tags |
| 462 | 462 | * @category sitemap |
| 463 | 463 | */ |
| 464 | -function lsx_sitemap_pages(){ |
|
| 464 | +function lsx_sitemap_pages() { |
|
| 465 | 465 | $posts_per_page = get_option('posts_per_page'); |
| 466 | - if(false == $posts_per_page){ |
|
| 466 | + if (false == $posts_per_page) { |
|
| 467 | 467 | $posts_per_page = 10; |
| 468 | 468 | } |
| 469 | 469 | |
@@ -474,13 +474,13 @@ discard block |
||
| 474 | 474 | 'post_type' => 'page', |
| 475 | 475 | ); |
| 476 | 476 | $pages = new WP_Query($page_args); |
| 477 | - if($pages->have_posts()){ |
|
| 477 | + if ($pages->have_posts()) { |
|
| 478 | 478 | |
| 479 | - echo '<h2>'.__( 'Pages', 'lsx' ).'</h2>'; |
|
| 479 | + echo '<h2>' . __('Pages', 'lsx') . '</h2>'; |
|
| 480 | 480 | |
| 481 | 481 | echo '<ul>'; |
| 482 | - while($pages->have_posts()){ $pages->the_post(); |
|
| 483 | - echo '<li class="page_item page-item-'.get_the_ID().'"><a href="'.get_permalink().'" title="">'.get_the_title().'</a></li>'; |
|
| 482 | + while ($pages->have_posts()) { $pages->the_post(); |
|
| 483 | + echo '<li class="page_item page-item-' . get_the_ID() . '"><a href="' . get_permalink() . '" title="">' . get_the_title() . '</a></li>'; |
|
| 484 | 484 | } |
| 485 | 485 | echo '</ul>'; |
| 486 | 486 | |
@@ -495,10 +495,10 @@ discard block |
||
| 495 | 495 | * @subpackage template-tags |
| 496 | 496 | * @category sitemap |
| 497 | 497 | */ |
| 498 | -function lsx_sitemap_custom_post_type(){ |
|
| 498 | +function lsx_sitemap_custom_post_type() { |
|
| 499 | 499 | |
| 500 | 500 | $posts_per_page = get_option('posts_per_page'); |
| 501 | - if(false == $posts_per_page){ |
|
| 501 | + if (false == $posts_per_page) { |
|
| 502 | 502 | $posts_per_page = 10; |
| 503 | 503 | } |
| 504 | 504 | |
@@ -506,8 +506,8 @@ discard block |
||
| 506 | 506 | 'public' => true, |
| 507 | 507 | '_builtin' => false |
| 508 | 508 | ); |
| 509 | - $post_types = get_post_types($args , 'names'); |
|
| 510 | - foreach($post_types as $post_type){ |
|
| 509 | + $post_types = get_post_types($args, 'names'); |
|
| 510 | + foreach ($post_types as $post_type) { |
|
| 511 | 511 | |
| 512 | 512 | $post_type_args = array( |
| 513 | 513 | 'post_type' => 'page', |
@@ -518,19 +518,19 @@ discard block |
||
| 518 | 518 | $post_type_items = new WP_Query($post_type_args); |
| 519 | 519 | |
| 520 | 520 | $post_type_object = get_post_type_object($post_type); |
| 521 | - if(null != $post_type_object){ |
|
| 521 | + if (null != $post_type_object) { |
|
| 522 | 522 | $title = $post_type_object->labels->name; |
| 523 | - }else{ |
|
| 523 | + } else { |
|
| 524 | 524 | $title = ucwords($post_type); |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | - if($post_type_items->have_posts()){ |
|
| 527 | + if ($post_type_items->have_posts()) { |
|
| 528 | 528 | |
| 529 | - printf( '<h2>'.__( '%1$s', 'lsx' ).'</h2>', $title ); |
|
| 529 | + printf('<h2>' . __('%1$s', 'lsx') . '</h2>', $title); |
|
| 530 | 530 | |
| 531 | 531 | echo '<ul>'; |
| 532 | - while($post_type_items->have_posts()){ $post_type_items->the_post(); |
|
| 533 | - echo '<li class="'.get_post_type().'_item '.get_post_type().'-item-'.get_the_ID().'"><a href="'.get_permalink().'" title="">'.get_the_title().'</a></li>'; |
|
| 532 | + while ($post_type_items->have_posts()) { $post_type_items->the_post(); |
|
| 533 | + echo '<li class="' . get_post_type() . '_item ' . get_post_type() . '-item-' . get_the_ID() . '"><a href="' . get_permalink() . '" title="">' . get_the_title() . '</a></li>'; |
|
| 534 | 534 | } |
| 535 | 535 | echo '</ul>'; |
| 536 | 536 | |
@@ -546,20 +546,20 @@ discard block |
||
| 546 | 546 | * @subpackage template-tags |
| 547 | 547 | * @category sitemap |
| 548 | 548 | */ |
| 549 | -function lsx_sitemap_taxonomy_clouds(){ |
|
| 549 | +function lsx_sitemap_taxonomy_clouds() { |
|
| 550 | 550 | |
| 551 | - $taxonomy_args = array( |
|
| 551 | + $taxonomy_args = array( |
|
| 552 | 552 | 'public' => true, |
| 553 | 553 | '_builtin' => false |
| 554 | 554 | ); |
| 555 | 555 | $taxonomies = get_taxonomies($taxonomy_args); |
| 556 | - if(!empty($taxonomies)){ |
|
| 557 | - foreach($taxonomies as $taxonomy_id => $taxonomy) { |
|
| 556 | + if ( ! empty($taxonomies)) { |
|
| 557 | + foreach ($taxonomies as $taxonomy_id => $taxonomy) { |
|
| 558 | 558 | |
| 559 | - $tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id,'echo'=>false)); |
|
| 560 | - if(null != $tag_cloud){ |
|
| 561 | - printf( '<h2>'.__( '%1$s', 'lsx' ).'</h2>', $taxonomy ); |
|
| 562 | - echo '<aside id="'.$taxonomy_id.'" class="widget widget_'.$taxonomy_id.'">'.$tag_cloud.'</aside>'; |
|
| 559 | + $tag_cloud = wp_tag_cloud(array('taxonomy'=>$taxonomy_id, 'echo'=>false)); |
|
| 560 | + if (null != $tag_cloud) { |
|
| 561 | + printf('<h2>' . __('%1$s', 'lsx') . '</h2>', $taxonomy); |
|
| 562 | + echo '<aside id="' . $taxonomy_id . '" class="widget widget_' . $taxonomy_id . '">' . $tag_cloud . '</aside>'; |
|
| 563 | 563 | } |
| 564 | 564 | } |
| 565 | 565 | } |
@@ -572,15 +572,15 @@ discard block |
||
| 572 | 572 | * @subpackage hooks |
| 573 | 573 | * @category forms |
| 574 | 574 | */ |
| 575 | -add_action( 'lsx_footer_before', 'lsx_footer_subscription_cta', 10 ); |
|
| 575 | +add_action('lsx_footer_before', 'lsx_footer_subscription_cta', 10); |
|
| 576 | 576 | function lsx_footer_subscription_cta() { |
| 577 | - if(!function_exists('lsx_is_form_enabled')){ return; } |
|
| 577 | + if ( ! function_exists('lsx_is_form_enabled')) { return; } |
|
| 578 | 578 | $subscribe_form_id = lsx_is_form_enabled('subscribe'); |
| 579 | - if(false == $subscribe_form_id) { return; } |
|
| 579 | + if (false == $subscribe_form_id) { return; } |
|
| 580 | 580 | |
| 581 | 581 | //add Caldera Forms Fields Scripts |
| 582 | - if( defined( 'CFCORE_VER' ) ){ |
|
| 583 | - wp_enqueue_script( 'cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER ); |
|
| 582 | + if (defined('CFCORE_VER')) { |
|
| 583 | + wp_enqueue_script('cf-frontend-fields', CFCORE_URL . 'assets/js/fields.min.js', array('jquery'), CFCORE_VER); |
|
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | ?> |
@@ -588,8 +588,8 @@ discard block |
||
| 588 | 588 | <div class="container"> |
| 589 | 589 | <div class="row"> |
| 590 | 590 | <div class="col-md-12"> |
| 591 | - <h2><?php _e( 'Subscribe to Our Newsletter', 'lsx' ); ?></h2> |
|
| 592 | - <?php echo do_shortcode( '[caldera_form id="'.$subscribe_form_id.'"]' ); ?> |
|
| 591 | + <h2><?php _e('Subscribe to Our Newsletter', 'lsx'); ?></h2> |
|
| 592 | + <?php echo do_shortcode('[caldera_form id="' . $subscribe_form_id . '"]'); ?> |
|
| 593 | 593 | </div> |
| 594 | 594 | </div> |
| 595 | 595 | </div> |
@@ -604,14 +604,14 @@ discard block |
||
| 604 | 604 | * @subpackage hooks |
| 605 | 605 | * @category menu |
| 606 | 606 | */ |
| 607 | -add_action( 'lsx_header_top', 'lsx_add_top_menu' ); |
|
| 607 | +add_action('lsx_header_top', 'lsx_add_top_menu'); |
|
| 608 | 608 | function lsx_add_top_menu() { |
| 609 | 609 | if (has_nav_menu('top-menu')) { ?> |
| 610 | 610 | <div id="top-menu" class="<?php lsx_top_menu_classes(); ?>"> |
| 611 | 611 | <div class="container"> |
| 612 | 612 | <nav class="top-menu"> |
| 613 | 613 | <?php |
| 614 | - wp_nav_menu( array( |
|
| 614 | + wp_nav_menu(array( |
|
| 615 | 615 | 'theme_location' => 'top-menu', |
| 616 | 616 | 'walker' => new lsx_bootstrap_navwalker()) |
| 617 | 617 | ); |
@@ -629,24 +629,24 @@ discard block |
||
| 629 | 629 | * @subpackage template-tag |
| 630 | 630 | * @category forms |
| 631 | 631 | */ |
| 632 | -if ( class_exists('Caldera_Forms') && !function_exists( 'lsx_is_form_enabled' ) ) { |
|
| 632 | +if (class_exists('Caldera_Forms') && ! function_exists('lsx_is_form_enabled')) { |
|
| 633 | 633 | function lsx_is_form_enabled($slug = false) { |
| 634 | - if(false == $slug){ return false; } |
|
| 634 | + if (false == $slug) { return false; } |
|
| 635 | 635 | |
| 636 | 636 | $match = false; |
| 637 | - $forms = get_option( '_caldera_forms' , false ); |
|
| 638 | - if(false !== $forms ) { |
|
| 639 | - foreach($forms as $form_id=>$form_maybe){ |
|
| 640 | - if( trim(strtolower($slug)) == strtolower($form_maybe['name']) ){ |
|
| 637 | + $forms = get_option('_caldera_forms', false); |
|
| 638 | + if (false !== $forms) { |
|
| 639 | + foreach ($forms as $form_id=>$form_maybe) { |
|
| 640 | + if (trim(strtolower($slug)) == strtolower($form_maybe['name'])) { |
|
| 641 | 641 | $match = $form_id; |
| 642 | 642 | break; |
| 643 | 643 | } |
| 644 | 644 | } |
| 645 | 645 | } |
| 646 | - if( false === $match ){ |
|
| 647 | - $is_form = Caldera_Forms::get_form( strtolower( $slug ) ); |
|
| 648 | - if( !empty( $is_form ) ){ |
|
| 649 | - return strtolower( $slug ); |
|
| 646 | + if (false === $match) { |
|
| 647 | + $is_form = Caldera_Forms::get_form(strtolower($slug)); |
|
| 648 | + if ( ! empty($is_form)) { |
|
| 649 | + return strtolower($slug); |
|
| 650 | 650 | } |
| 651 | 651 | } |
| 652 | 652 | |
@@ -662,10 +662,10 @@ discard block |
||
| 662 | 662 | * @category urls |
| 663 | 663 | */ |
| 664 | 664 | function lsx_get_my_url() { |
| 665 | - if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) |
|
| 665 | + if ( ! preg_match('/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches)) |
|
| 666 | 666 | return false; |
| 667 | 667 | |
| 668 | - return esc_url_raw( $matches[1] ); |
|
| 668 | + return esc_url_raw($matches[1]); |
|
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | /** |
@@ -675,19 +675,19 @@ discard block |
||
| 675 | 675 | * @subpackage extras |
| 676 | 676 | * @category urls |
| 677 | 677 | */ |
| 678 | -function lsx_get_template_part($slug,$part) { |
|
| 678 | +function lsx_get_template_part($slug, $part) { |
|
| 679 | 679 | $template = array(); |
| 680 | 680 | $part = (string) $part; |
| 681 | - if ( '' !== $part ){ |
|
| 681 | + if ('' !== $part) { |
|
| 682 | 682 | $template = "{$slug}-{$part}.php"; |
| 683 | - }else{ |
|
| 683 | + } else { |
|
| 684 | 684 | $template = "{$slug}.php"; |
| 685 | 685 | } |
| 686 | - $file_path = apply_filters('lsx_content_path',false,$slug,$part); |
|
| 686 | + $file_path = apply_filters('lsx_content_path', false, $slug, $part); |
|
| 687 | 687 | |
| 688 | - if ( false !== $file_path && '' == locate_template( array( $template ) ) && file_exists( $file_path.$template) ) { |
|
| 689 | - load_template( $file_path.$template, false ); |
|
| 690 | - }else{ |
|
| 691 | - get_template_part($slug,$part); |
|
| 688 | + if (false !== $file_path && '' == locate_template(array($template)) && file_exists($file_path . $template)) { |
|
| 689 | + load_template($file_path . $template, false); |
|
| 690 | + } else { |
|
| 691 | + get_template_part($slug, $part); |
|
| 692 | 692 | } |
| 693 | 693 | } |
| 694 | 694 | \ No newline at end of file |