@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | <?php lsx_content_wrap_before(); ?> |
| 12 | 12 | |
| 13 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
| 13 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
| 14 | 14 | |
| 15 | 15 | <?php lsx_content_before(); ?> |
| 16 | 16 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | <?php lsx_content_top(); ?> |
| 20 | 20 | |
| 21 | - <?php while ( have_posts() ) : the_post(); ?> |
|
| 21 | + <?php while (have_posts()) : the_post(); ?> |
|
| 22 | 22 | |
| 23 | 23 | <?php lsx_entry_before(); ?> |
| 24 | 24 | |
@@ -32,25 +32,25 @@ discard block |
||
| 32 | 32 | <div class="entry-meta"> |
| 33 | 33 | <?php |
| 34 | 34 | $metadata = wp_get_attachment_metadata(); |
| 35 | - printf( wp_kses_post( '%1$s <span class="entry-date"><time class="entry-date" datetime="%2$s" pubdate>%3$s</time></span> %4$s <a href="%5$s">%6$s × %7$s</a> %8$s <a href="%9$s" title="%10$s" rel="gallery">%10$s</a>' ), |
|
| 36 | - esc_html__( 'Published', 'lsx' ), |
|
| 37 | - esc_attr( get_the_date( 'c' ) ), |
|
| 38 | - esc_html( get_the_date() ), |
|
| 39 | - esc_html__( 'at', 'lsx' ), |
|
| 40 | - esc_url( wp_get_attachment_url() ), |
|
| 41 | - esc_attr( $metadata['width'] ), |
|
| 42 | - esc_attr( $metadata['height'] ), |
|
| 43 | - esc_html__( 'in', 'lsx' ), |
|
| 44 | - esc_url( get_permalink( $post->post_parent ) ), |
|
| 45 | - get_the_title( $post->post_parent ) |
|
| 35 | + printf(wp_kses_post('%1$s <span class="entry-date"><time class="entry-date" datetime="%2$s" pubdate>%3$s</time></span> %4$s <a href="%5$s">%6$s × %7$s</a> %8$s <a href="%9$s" title="%10$s" rel="gallery">%10$s</a>'), |
|
| 36 | + esc_html__('Published', 'lsx'), |
|
| 37 | + esc_attr(get_the_date('c')), |
|
| 38 | + esc_html(get_the_date()), |
|
| 39 | + esc_html__('at', 'lsx'), |
|
| 40 | + esc_url(wp_get_attachment_url()), |
|
| 41 | + esc_attr($metadata['width']), |
|
| 42 | + esc_attr($metadata['height']), |
|
| 43 | + esc_html__('in', 'lsx'), |
|
| 44 | + esc_url(get_permalink($post->post_parent)), |
|
| 45 | + get_the_title($post->post_parent) |
|
| 46 | 46 | ); |
| 47 | 47 | ?> |
| 48 | - <?php edit_post_link( esc_html__( 'Edit', 'lsx' ), '<span class="sep"> | </span> <span class="edit-link">', '</span>' ); ?> |
|
| 48 | + <?php edit_post_link(esc_html__('Edit', 'lsx'), '<span class="sep"> | </span> <span class="edit-link">', '</span>'); ?> |
|
| 49 | 49 | </div><!-- .entry-meta --> |
| 50 | 50 | |
| 51 | 51 | <nav id="image-navigation" class="site-navigation"> |
| 52 | - <span class="previous-image"><?php previous_image_link( false, '← '.esc_html__( 'Previous', 'lsx' ) ); ?></span> |
|
| 53 | - <span class="next-image"><?php next_image_link( false, esc_html__( 'Next', 'lsx' ).' →' ); ?></span> |
|
| 52 | + <span class="previous-image"><?php previous_image_link(false, '← ' . esc_html__('Previous', 'lsx')); ?></span> |
|
| 53 | + <span class="next-image"><?php next_image_link(false, esc_html__('Next', 'lsx') . ' →'); ?></span> |
|
| 54 | 54 | </nav><!-- #image-navigation --> |
| 55 | 55 | </header><!-- .entry-header --> |
| 56 | 56 | |
@@ -63,33 +63,33 @@ discard block |
||
| 63 | 63 | * Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery, |
| 64 | 64 | * or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file |
| 65 | 65 | */ |
| 66 | - $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); |
|
| 67 | - foreach ( $attachments as $k => $attachment ) { |
|
| 68 | - if ( $attachment->ID == $post->ID ) |
|
| 66 | + $attachments = array_values(get_children(array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID'))); |
|
| 67 | + foreach ($attachments as $k => $attachment) { |
|
| 68 | + if ($attachment->ID == $post->ID) |
|
| 69 | 69 | break; |
| 70 | 70 | } |
| 71 | 71 | $k++; |
| 72 | 72 | // If there is more than 1 attachment in a gallery |
| 73 | - if ( count( $attachments ) > 1 ) { |
|
| 74 | - if ( isset( $attachments[ $k ] ) ) |
|
| 73 | + if (count($attachments) > 1) { |
|
| 74 | + if (isset($attachments[$k])) |
|
| 75 | 75 | // get the URL of the next image attachment |
| 76 | - $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); |
|
| 76 | + $next_attachment_url = get_attachment_link($attachments[$k]->ID); |
|
| 77 | 77 | else |
| 78 | 78 | // or get the URL of the first image attachment |
| 79 | - $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); |
|
| 79 | + $next_attachment_url = get_attachment_link($attachments[0]->ID); |
|
| 80 | 80 | } else { |
| 81 | 81 | // or, if there's only 1 image, get the URL of the image |
| 82 | 82 | $next_attachment_url = wp_get_attachment_url(); |
| 83 | 83 | } |
| 84 | 84 | ?> |
| 85 | 85 | |
| 86 | - <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php |
|
| 87 | - $attachment_size = apply_filters( 'shape_attachment_size', array( 1200, 1200 ) ); // Filterable image size. |
|
| 88 | - echo wp_get_attachment_image( $post->ID, $attachment_size ); |
|
| 86 | + <a href="<?php echo esc_url($next_attachment_url); ?>" title="<?php echo esc_attr(get_the_title()); ?>" rel="attachment"><?php |
|
| 87 | + $attachment_size = apply_filters('shape_attachment_size', array(1200, 1200)); // Filterable image size. |
|
| 88 | + echo wp_get_attachment_image($post->ID, $attachment_size); |
|
| 89 | 89 | ?></a> |
| 90 | 90 | </div><!-- .attachment --> |
| 91 | 91 | |
| 92 | - <?php if ( ! empty( $post->post_excerpt ) ) : ?> |
|
| 92 | + <?php if ( ! empty($post->post_excerpt)) : ?> |
|
| 93 | 93 | <div class="entry-caption"> |
| 94 | 94 | <?php the_excerpt(); ?> |
| 95 | 95 | </div><!-- .entry-caption --> |
@@ -99,27 +99,27 @@ discard block |
||
| 99 | 99 | <?php |
| 100 | 100 | the_content(); |
| 101 | 101 | |
| 102 | - wp_link_pages( array( |
|
| 102 | + wp_link_pages(array( |
|
| 103 | 103 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
| 104 | 104 | 'after' => '</div></div>', |
| 105 | 105 | 'link_before' => '<span>', |
| 106 | 106 | 'link_after' => '</span>' |
| 107 | - ) ); |
|
| 107 | + )); |
|
| 108 | 108 | ?> |
| 109 | 109 | |
| 110 | 110 | </div><!-- .entry-content --> |
| 111 | 111 | |
| 112 | 112 | <footer class="entry-meta"> |
| 113 | 113 | |
| 114 | - <?php if ( ! is_single() ) : ?> |
|
| 114 | + <?php if ( ! is_single()) : ?> |
|
| 115 | 115 | <a class="read-more" href="<?php the_permalink(); ?>">Read More</a> |
| 116 | 116 | <?php endif ?> |
| 117 | 117 | |
| 118 | - <?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?> |
|
| 119 | - <span class="comments-link"><?php comments_popup_link( esc_html__( 'Leave a comment', 'lsx' ), esc_html__( '1 Comment', 'lsx' ), esc_html__( '% Comments', 'lsx' ) ); ?></span> |
|
| 118 | + <?php if ( ! post_password_required() && (comments_open() || '0' != get_comments_number())) : ?> |
|
| 119 | + <span class="comments-link"><?php comments_popup_link(esc_html__('Leave a comment', 'lsx'), esc_html__('1 Comment', 'lsx'), esc_html__('% Comments', 'lsx')); ?></span> |
|
| 120 | 120 | <?php endif; ?> |
| 121 | 121 | |
| 122 | - <?php edit_post_link( esc_html__( 'Edit', 'lsx' ), '<span class="edit-link">', '</span>' ); ?> |
|
| 122 | + <?php edit_post_link(esc_html__('Edit', 'lsx'), '<span class="edit-link">', '</span>'); ?> |
|
| 123 | 123 | </footer><!-- .entry-meta --> |
| 124 | 124 | |
| 125 | 125 | <?php lsx_entry_bottom(); ?> |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | <?php |
| 130 | 130 | // If comments are open or we have at least one comment, load up the comment template |
| 131 | - if ( comments_open() || '0' != get_comments_number() ) : |
|
| 131 | + if (comments_open() || '0' != get_comments_number()) : |
|
| 132 | 132 | comments_template(); |
| 133 | 133 | endif; |
| 134 | 134 | ?> |
@@ -7,18 +7,18 @@ discard block |
||
| 7 | 7 | <?php lsx_entry_before(); ?> |
| 8 | 8 | |
| 9 | 9 | <?php |
| 10 | - if ( has_post_thumbnail() ) { |
|
| 10 | + if (has_post_thumbnail()) { |
|
| 11 | 11 | $thumb_class = 'has-thumb'; |
| 12 | 12 | } else { |
| 13 | 13 | $thumb_class = 'no-thumb'; |
| 14 | 14 | } |
| 15 | 15 | ?> |
| 16 | 16 | |
| 17 | -<article id="post-<?php the_ID(); ?>" <?php post_class( $thumb_class ); ?>> |
|
| 17 | +<article id="post-<?php the_ID(); ?>" <?php post_class($thumb_class); ?>> |
|
| 18 | 18 | <?php lsx_entry_top(); ?> |
| 19 | 19 | |
| 20 | 20 | <header class="entry-header"> |
| 21 | - <?php if ( has_post_thumbnail() ) { ?> |
|
| 21 | + <?php if (has_post_thumbnail()) { ?> |
|
| 22 | 22 | <div class="entry-image"> |
| 23 | 23 | <a class="thumbnail" href="<?php the_permalink(); ?>"> |
| 24 | 24 | <?php lsx_thumbnail('lsx-single-thumbnail'); ?> |
@@ -28,35 +28,35 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | <?php |
| 30 | 30 | $format = get_post_format(); |
| 31 | - if ( false === $format ) { |
|
| 31 | + if (false === $format) { |
|
| 32 | 32 | $format = 'standard'; |
| 33 | - $show_on_front = get_option('show_on_front','posts'); |
|
| 34 | - if('page' == $show_on_front){ |
|
| 33 | + $show_on_front = get_option('show_on_front', 'posts'); |
|
| 34 | + if ('page' == $show_on_front) { |
|
| 35 | 35 | $archive_link = get_permalink(get_option('page_for_posts')); |
| 36 | - }else{ |
|
| 36 | + } else { |
|
| 37 | 37 | $archive_link = home_url(); |
| 38 | 38 | } |
| 39 | - }else{ |
|
| 39 | + } else { |
|
| 40 | 40 | $archive_link = get_post_format_link($format); |
| 41 | 41 | } |
| 42 | 42 | $format = lsx_translate_format_to_fontawesome($format); |
| 43 | 43 | ?> |
| 44 | 44 | |
| 45 | 45 | <h1 class="entry-title"> |
| 46 | - <?php if ( has_post_thumbnail() ) { ?> |
|
| 47 | - <a href="<?php echo esc_url($archive_link) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
| 46 | + <?php if (has_post_thumbnail()) { ?> |
|
| 47 | + <a href="<?php echo esc_url($archive_link) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr($format) ?>"></a> |
|
| 48 | 48 | <?php } else { ?> |
| 49 | - <a href="<?php echo esc_url($archive_link) ?>" class="format-link fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
| 49 | + <a href="<?php echo esc_url($archive_link) ?>" class="format-link fa fa-<?php echo esc_attr($format) ?>"></a> |
|
| 50 | 50 | <?php } ?> |
| 51 | 51 | |
| 52 | - <?php if ( has_post_format( array('link') ) ) { ?> |
|
| 53 | - <a href="<?php echo esc_url( lsx_get_my_url() ); ?>" rel="bookmark"><?php the_title(); ?> <span class="fa fa-external-link"></span></a> |
|
| 52 | + <?php if (has_post_format(array('link'))) { ?> |
|
| 53 | + <a href="<?php echo esc_url(lsx_get_my_url()); ?>" rel="bookmark"><?php the_title(); ?> <span class="fa fa-external-link"></span></a> |
|
| 54 | 54 | <?php } else { ?> |
| 55 | 55 | <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> |
| 56 | 56 | <?php } ?> |
| 57 | 57 | |
| 58 | - <?php if ( is_sticky() ) { ?> |
|
| 59 | - <span class="label label-default label-sticky"><?php esc_html_e('Featured','lsx'); ?></span> |
|
| 58 | + <?php if (is_sticky()) { ?> |
|
| 59 | + <span class="label label-default label-sticky"><?php esc_html_e('Featured', 'lsx'); ?></span> |
|
| 60 | 60 | <?php } ?> |
| 61 | 61 | </h1> |
| 62 | 62 | |
@@ -65,37 +65,37 @@ discard block |
||
| 65 | 65 | </div><!-- .entry-meta --> |
| 66 | 66 | </header><!-- .entry-header --> |
| 67 | 67 | |
| 68 | - <?php if ( !is_singular() && !has_post_format( array('video', 'audio', 'quote', 'link') ) ) : // Only display Excerpts for Search and Archives ?> |
|
| 68 | + <?php if ( ! is_singular() && ! has_post_format(array('video', 'audio', 'quote', 'link'))) : // Only display Excerpts for Search and Archives ?> |
|
| 69 | 69 | <div class="entry-summary"> |
| 70 | 70 | <?php the_excerpt(); ?> |
| 71 | 71 | </div><!-- .entry-summary --> |
| 72 | - <?php elseif ( has_post_format( array('link') ) ) : ?> |
|
| 72 | + <?php elseif (has_post_format(array('link'))) : ?> |
|
| 73 | 73 | |
| 74 | 74 | <?php else : ?> |
| 75 | 75 | <div class="entry-content"> |
| 76 | 76 | <?php |
| 77 | 77 | the_content(); |
| 78 | 78 | |
| 79 | - wp_link_pages( array( |
|
| 79 | + wp_link_pages(array( |
|
| 80 | 80 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
| 81 | 81 | 'after' => '</div></div>', |
| 82 | 82 | 'link_before' => '<span>', |
| 83 | 83 | 'link_after' => '</span>' |
| 84 | - ) ); |
|
| 84 | + )); |
|
| 85 | 85 | ?> |
| 86 | 86 | </div><!-- .entry-content --> |
| 87 | 87 | <?php endif; ?> |
| 88 | 88 | |
| 89 | - <?php if ( has_tag() || ( comments_open() && ! empty( get_comments_number() ) ) ) : ?> |
|
| 89 | + <?php if (has_tag() || (comments_open() && ! empty(get_comments_number()))) : ?> |
|
| 90 | 90 | <div class="post-tags-wrapper"> |
| 91 | 91 | <?php lsx_content_post_tags(); ?> |
| 92 | 92 | |
| 93 | - <?php if ( comments_open() && ! empty( get_comments_number() ) ) : ?> |
|
| 93 | + <?php if (comments_open() && ! empty(get_comments_number())) : ?> |
|
| 94 | 94 | <div class="post-comments"> |
| 95 | 95 | <a href="<?php the_permalink() ?>#comments"> |
| 96 | 96 | <?php |
| 97 | 97 | $count = get_comments_number(); |
| 98 | - printf( esc_html( _n( 'One Comment', '%1$s Comments', $count, 'lsx' ) ), esc_html( number_format_i18n( $count ) ) ); |
|
| 98 | + printf(esc_html(_n('One Comment', '%1$s Comments', $count, 'lsx')), esc_html(number_format_i18n($count))); |
|
| 99 | 99 | ?> |
| 100 | 100 | </a> |
| 101 | 101 | </div> |
@@ -108,9 +108,9 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | <div class="clearfix"></div> |
| 110 | 110 | |
| 111 | - <?php edit_post_link( __( 'Edit', 'lsx' ), '<span class="edit-link">', '</span>' ); ?> |
|
| 111 | + <?php edit_post_link(__('Edit', 'lsx'), '<span class="edit-link">', '</span>'); ?> |
|
| 112 | 112 | |
| 113 | - <?php if ( !is_singular() && !is_single() ) { // Display full-width divider on Archives ?> |
|
| 113 | + <?php if ( ! is_singular() && ! is_single()) { // Display full-width divider on Archives ?> |
|
| 114 | 114 | <div class="lsx-breaker"></div> |
| 115 | 115 | <?php } ?> |
| 116 | 116 | </article><!-- #post-## --> |
@@ -12,20 +12,20 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | <?php |
| 14 | 14 | $format = get_post_format(); |
| 15 | - if ( false === $format ) { |
|
| 15 | + if (false === $format) { |
|
| 16 | 16 | $format = 'standard'; |
| 17 | 17 | } |
| 18 | 18 | $format_link = get_post_format_link($format); |
| 19 | 19 | $format = lsx_translate_format_to_fontawesome($format); |
| 20 | 20 | ?> |
| 21 | 21 | |
| 22 | - <?php if ( ! is_single() ) { ?> |
|
| 22 | + <?php if ( ! is_single()) { ?> |
|
| 23 | 23 | <header class="entry-header"> |
| 24 | 24 | <h1 class="entry-title"> |
| 25 | - <?php if ( has_post_thumbnail() ) { ?> |
|
| 26 | - <a href="<?php echo esc_url($format_link) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
| 25 | + <?php if (has_post_thumbnail()) { ?> |
|
| 26 | + <a href="<?php echo esc_url($format_link) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr($format) ?>"></a> |
|
| 27 | 27 | <?php } else { ?> |
| 28 | - <a href="<?php echo esc_url($format_link) ?>" class="format-link fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
| 28 | + <a href="<?php echo esc_url($format_link) ?>" class="format-link fa fa-<?php echo esc_attr($format) ?>"></a> |
|
| 29 | 29 | <?php } ?> |
| 30 | 30 | |
| 31 | 31 | <span><?php the_title(); ?></span> |
@@ -39,33 +39,33 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | <div class="entry-content"> |
| 41 | 41 | <?php |
| 42 | - if ( ! is_singular() ) { |
|
| 42 | + if ( ! is_singular()) { |
|
| 43 | 43 | the_excerpt(); |
| 44 | 44 | } else { |
| 45 | 45 | the_content(); |
| 46 | 46 | |
| 47 | - wp_link_pages( array( |
|
| 47 | + wp_link_pages(array( |
|
| 48 | 48 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
| 49 | 49 | 'after' => '</div></div>', |
| 50 | 50 | 'link_before' => '<span>', |
| 51 | 51 | 'link_after' => '</span>' |
| 52 | - ) ); |
|
| 52 | + )); |
|
| 53 | 53 | } ?> |
| 54 | 54 | </div><!-- .entry-content --> |
| 55 | 55 | |
| 56 | 56 | <footer class="footer-meta"> |
| 57 | - <?php if ( has_tag() || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) : ?> |
|
| 57 | + <?php if (has_tag() || (function_exists('sharing_display') || class_exists('Jetpack_Likes'))) : ?> |
|
| 58 | 58 | <div class="post-tags-wrapper"> |
| 59 | 59 | <?php lsx_content_post_tags(); ?> |
| 60 | 60 | |
| 61 | 61 | <?php |
| 62 | - if ( function_exists( 'sharing_display' ) ) { |
|
| 63 | - sharing_display( '', true ); |
|
| 62 | + if (function_exists('sharing_display')) { |
|
| 63 | + sharing_display('', true); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
| 66 | + if (class_exists('Jetpack_Likes')) { |
|
| 67 | 67 | $custom_likes = new Jetpack_Likes; |
| 68 | - echo wp_kses_post( $custom_likes->post_likes( '' ) ); |
|
| 68 | + echo wp_kses_post($custom_likes->post_likes('')); |
|
| 69 | 69 | } |
| 70 | 70 | ?> |
| 71 | 71 | </div> |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | <?php |
| 75 | 75 | // If comments are open or we have at least one comment, load up the comment template |
| 76 | - if ( comments_open() || '0' != get_comments_number() ) : ?> |
|
| 77 | - <a class="comments-link post-meta-link" data-toggle="collapse" href="#comments-collapse"><strong><?php echo esc_html( get_comments_number() ) ?></strong> <?php esc_html_e('Comments','lsx'); ?> <span class="fa fa-chevron-down"></span></a> |
|
| 76 | + if (comments_open() || '0' != get_comments_number()) : ?> |
|
| 77 | + <a class="comments-link post-meta-link" data-toggle="collapse" href="#comments-collapse"><strong><?php echo esc_html(get_comments_number()) ?></strong> <?php esc_html_e('Comments', 'lsx'); ?> <span class="fa fa-chevron-down"></span></a> |
|
| 78 | 78 | |
| 79 | 79 | <div class="collapse" id="comments-collapse"> |
| 80 | 80 | <?php |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | <?php endif; ?> |
| 85 | 85 | </footer><!-- .footer-meta --> |
| 86 | 86 | |
| 87 | - <?php edit_post_link( __( 'Edit', 'lsx' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?> |
|
| 87 | + <?php edit_post_link(__('Edit', 'lsx'), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>'); ?> |
|
| 88 | 88 | |
| 89 | 89 | <?php lsx_portfolio_related_posts(); ?> |
| 90 | 90 | |
@@ -24,11 +24,11 @@ discard block |
||
| 24 | 24 | * $lsx_supports[] = 'body'; |
| 25 | 25 | */ |
| 26 | 26 | function lsx_body_top() { |
| 27 | - do_action( 'lsx_body_top' ); |
|
| 27 | + do_action('lsx_body_top'); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | function lsx_body_bottom() { |
| 31 | - do_action( 'lsx_body_bottom' ); |
|
| 31 | + do_action('lsx_body_bottom'); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -37,11 +37,11 @@ discard block |
||
| 37 | 37 | * $lsx_supports[] = 'head'; |
| 38 | 38 | */ |
| 39 | 39 | function lsx_head_top() { |
| 40 | - do_action( 'lsx_head_top' ); |
|
| 40 | + do_action('lsx_head_top'); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | function lsx_head_bottom() { |
| 44 | - do_action( 'lsx_head_bottom' ); |
|
| 44 | + do_action('lsx_head_bottom'); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -50,27 +50,27 @@ discard block |
||
| 50 | 50 | * $lsx_supports[] = 'header'; |
| 51 | 51 | */ |
| 52 | 52 | function lsx_header_before() { |
| 53 | - do_action( 'lsx_header_before' ); |
|
| 53 | + do_action('lsx_header_before'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | function lsx_header_after() { |
| 57 | - do_action( 'lsx_header_after' ); |
|
| 57 | + do_action('lsx_header_after'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | function lsx_header_top() { |
| 61 | - do_action( 'lsx_header_top' ); |
|
| 61 | + do_action('lsx_header_top'); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | function lsx_header_bottom() { |
| 65 | - do_action( 'lsx_header_bottom' ); |
|
| 65 | + do_action('lsx_header_bottom'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | function lsx_nav_before() { |
| 69 | - do_action( 'lsx_nav_before' ); |
|
| 69 | + do_action('lsx_nav_before'); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | function lsx_nav_after() { |
| 73 | - do_action( 'lsx_nav_after' ); |
|
| 73 | + do_action('lsx_nav_after'); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | |
| 82 | 82 | function lsx_banner_content() { |
| 83 | - do_action( 'lsx_banner_content' ); |
|
| 83 | + do_action('lsx_banner_content'); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -89,35 +89,35 @@ discard block |
||
| 89 | 89 | * $lsx_supports[] = 'content'; |
| 90 | 90 | */ |
| 91 | 91 | function lsx_content_wrap_before() { |
| 92 | - do_action( 'lsx_content_wrap_before' ); |
|
| 92 | + do_action('lsx_content_wrap_before'); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | function lsx_content_wrap_after() { |
| 96 | - do_action( 'lsx_content_wrap_after' ); |
|
| 96 | + do_action('lsx_content_wrap_after'); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | function lsx_content_before() { |
| 100 | - do_action( 'lsx_content_before' ); |
|
| 100 | + do_action('lsx_content_before'); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | function lsx_content_after() { |
| 104 | - do_action( 'lsx_content_after' ); |
|
| 104 | + do_action('lsx_content_after'); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | function lsx_content_top() { |
| 108 | - do_action( 'lsx_content_top' ); |
|
| 108 | + do_action('lsx_content_top'); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | function lsx_content_bottom() { |
| 112 | - do_action( 'lsx_content_bottom' ); |
|
| 112 | + do_action('lsx_content_bottom'); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | function lsx_content_post_meta() { |
| 116 | - do_action( 'lsx_content_post_meta' ); |
|
| 116 | + do_action('lsx_content_post_meta'); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | function lsx_content_post_tags() { |
| 120 | - do_action( 'lsx_content_post_tags' ); |
|
| 120 | + do_action('lsx_content_post_tags'); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -126,19 +126,19 @@ discard block |
||
| 126 | 126 | * $lsx_supports[] = 'entry'; |
| 127 | 127 | */ |
| 128 | 128 | function lsx_entry_before() { |
| 129 | - do_action( 'lsx_entry_before' ); |
|
| 129 | + do_action('lsx_entry_before'); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | function lsx_entry_after() { |
| 133 | - do_action( 'lsx_entry_after' ); |
|
| 133 | + do_action('lsx_entry_after'); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | function lsx_entry_top() { |
| 137 | - do_action( 'lsx_entry_top' ); |
|
| 137 | + do_action('lsx_entry_top'); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | function lsx_entry_bottom() { |
| 141 | - do_action( 'lsx_entry_bottom' ); |
|
| 141 | + do_action('lsx_entry_bottom'); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | * $lsx_supports[] = 'comments'; |
| 148 | 148 | */ |
| 149 | 149 | function lsx_comments_before() { |
| 150 | - do_action( 'lsx_comments_before' ); |
|
| 150 | + do_action('lsx_comments_before'); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | function lsx_comments_after() { |
| 154 | - do_action( 'lsx_comments_after' ); |
|
| 154 | + do_action('lsx_comments_after'); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
@@ -160,19 +160,19 @@ discard block |
||
| 160 | 160 | * $lsx_supports[] = 'sidebar'; |
| 161 | 161 | */ |
| 162 | 162 | function lsx_sidebars_before() { |
| 163 | - do_action( 'lsx_sidebars_before' ); |
|
| 163 | + do_action('lsx_sidebars_before'); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | function lsx_sidebars_after() { |
| 167 | - do_action( 'lsx_sidebars_after' ); |
|
| 167 | + do_action('lsx_sidebars_after'); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | function lsx_sidebar_top() { |
| 171 | - do_action( 'lsx_sidebar_top' ); |
|
| 171 | + do_action('lsx_sidebar_top'); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | function lsx_sidebar_bottom() { |
| 175 | - do_action( 'lsx_sidebar_bottom' ); |
|
| 175 | + do_action('lsx_sidebar_bottom'); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | /** |
@@ -181,17 +181,17 @@ discard block |
||
| 181 | 181 | * $lsx_supports[] = 'footer'; |
| 182 | 182 | */ |
| 183 | 183 | function lsx_footer_before() { |
| 184 | - do_action( 'lsx_footer_before' ); |
|
| 184 | + do_action('lsx_footer_before'); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | function lsx_footer_after() { |
| 188 | - do_action( 'lsx_footer_after' ); |
|
| 188 | + do_action('lsx_footer_after'); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | function lsx_footer_top() { |
| 192 | - do_action( 'lsx_footer_top' ); |
|
| 192 | + do_action('lsx_footer_top'); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | function lsx_footer_bottom() { |
| 196 | - do_action( 'lsx_footer_bottom' ); |
|
| 196 | + do_action('lsx_footer_bottom'); |
|
| 197 | 197 | } |
| 198 | 198 | \ No newline at end of file |
@@ -12,20 +12,20 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | <?php |
| 14 | 14 | $format = get_post_format(); |
| 15 | - if ( false === $format ) { |
|
| 15 | + if (false === $format) { |
|
| 16 | 16 | $format = 'standard'; |
| 17 | 17 | } |
| 18 | 18 | $format_link = get_post_format_link($format); |
| 19 | 19 | $format = lsx_translate_format_to_fontawesome($format); |
| 20 | 20 | ?> |
| 21 | 21 | |
| 22 | - <?php if ( ! is_single() ) { ?> |
|
| 22 | + <?php if ( ! is_single()) { ?> |
|
| 23 | 23 | <header class="entry-header"> |
| 24 | 24 | <h1 class="entry-title"> |
| 25 | - <?php if ( has_post_thumbnail() ) { ?> |
|
| 26 | - <a href="<?php echo esc_url($format_link) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
| 25 | + <?php if (has_post_thumbnail()) { ?> |
|
| 26 | + <a href="<?php echo esc_url($format_link) ?>" class="format-link has-thumb fa fa-<?php echo esc_attr($format) ?>"></a> |
|
| 27 | 27 | <?php } else { ?> |
| 28 | - <a href="<?php echo esc_url($format_link) ?>" class="format-link fa fa-<?php echo esc_attr( $format ) ?>"></a> |
|
| 28 | + <a href="<?php echo esc_url($format_link) ?>" class="format-link fa fa-<?php echo esc_attr($format) ?>"></a> |
|
| 29 | 29 | <?php } ?> |
| 30 | 30 | |
| 31 | 31 | <span><?php the_title(); ?></span> |
@@ -39,33 +39,33 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | <div class="entry-content"> |
| 41 | 41 | <?php |
| 42 | - if ( ! is_singular() ) { |
|
| 42 | + if ( ! is_singular()) { |
|
| 43 | 43 | the_excerpt(); |
| 44 | 44 | } else { |
| 45 | 45 | the_content(); |
| 46 | 46 | |
| 47 | - wp_link_pages( array( |
|
| 47 | + wp_link_pages(array( |
|
| 48 | 48 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
| 49 | 49 | 'after' => '</div></div>', |
| 50 | 50 | 'link_before' => '<span>', |
| 51 | 51 | 'link_after' => '</span>' |
| 52 | - ) ); |
|
| 52 | + )); |
|
| 53 | 53 | } ?> |
| 54 | 54 | </div><!-- .entry-content --> |
| 55 | 55 | |
| 56 | 56 | <footer class="footer-meta"> |
| 57 | - <?php if ( has_tag() || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) : ?> |
|
| 57 | + <?php if (has_tag() || (function_exists('sharing_display') || class_exists('Jetpack_Likes'))) : ?> |
|
| 58 | 58 | <div class="post-tags-wrapper"> |
| 59 | 59 | <?php lsx_content_post_tags(); ?> |
| 60 | 60 | |
| 61 | 61 | <?php |
| 62 | - if ( function_exists( 'sharing_display' ) ) { |
|
| 63 | - sharing_display( '', true ); |
|
| 62 | + if (function_exists('sharing_display')) { |
|
| 63 | + sharing_display('', true); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
| 66 | + if (class_exists('Jetpack_Likes')) { |
|
| 67 | 67 | $custom_likes = new Jetpack_Likes; |
| 68 | - echo wp_kses_post( $custom_likes->post_likes( '' ) ); |
|
| 68 | + echo wp_kses_post($custom_likes->post_likes('')); |
|
| 69 | 69 | } |
| 70 | 70 | ?> |
| 71 | 71 | </div> |
@@ -73,8 +73,8 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | <?php |
| 75 | 75 | // If comments are open or we have at least one comment, load up the comment template |
| 76 | - if ( comments_open() || '0' != get_comments_number() ) : ?> |
|
| 77 | - <a class="comments-link post-meta-link" data-toggle="collapse" href="#comments-collapse"><strong><?php echo esc_html( get_comments_number() ) ?></strong> <?php esc_html_e('Comments','lsx'); ?> <span class="fa fa-chevron-down"></span></a> |
|
| 76 | + if (comments_open() || '0' != get_comments_number()) : ?> |
|
| 77 | + <a class="comments-link post-meta-link" data-toggle="collapse" href="#comments-collapse"><strong><?php echo esc_html(get_comments_number()) ?></strong> <?php esc_html_e('Comments', 'lsx'); ?> <span class="fa fa-chevron-down"></span></a> |
|
| 78 | 78 | |
| 79 | 79 | <div class="collapse" id="comments-collapse"> |
| 80 | 80 | <?php |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | <?php endif; ?> |
| 85 | 85 | </footer><!-- .footer-meta --> |
| 86 | 86 | |
| 87 | - <?php edit_post_link( __( 'Edit', 'lsx' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?> |
|
| 87 | + <?php edit_post_link(__('Edit', 'lsx'), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>'); ?> |
|
| 88 | 88 | |
| 89 | 89 | <?php lsx_portfolio_related_posts(); ?> |
| 90 | 90 | |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | <?php lsx_content_wrap_before(); ?> |
| 11 | 11 | |
| 12 | - <div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
| 12 | + <div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
| 13 | 13 | |
| 14 | 14 | <?php lsx_content_before(); ?> |
| 15 | 15 | |
@@ -17,25 +17,25 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | <?php lsx_content_top(); ?> |
| 19 | 19 | |
| 20 | - <?php if ( have_posts() ) : global $lsx_archive; $lsx_archive = 1; ?> |
|
| 20 | + <?php if (have_posts()) : global $lsx_archive; $lsx_archive = 1; ?> |
|
| 21 | 21 | |
| 22 | 22 | <?php |
| 23 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 24 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
| 25 | - if('1c' === $layout){ |
|
| 23 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 24 | + $layout = apply_filters('lsx_layout', $layout); |
|
| 25 | + if ('1c' === $layout) { |
|
| 26 | 26 | lsx_breadcrumbs(); |
| 27 | 27 | } |
| 28 | 28 | ?> |
| 29 | 29 | |
| 30 | 30 | <?php /* Start the Loop */ ?> |
| 31 | - <?php while ( have_posts() ) : the_post(); ?> |
|
| 31 | + <?php while (have_posts()) : the_post(); ?> |
|
| 32 | 32 | |
| 33 | 33 | <?php |
| 34 | 34 | /* Include the Post-Format-specific template for the content. |
| 35 | 35 | * If you want to override this in a child theme, then include a file |
| 36 | 36 | * called content-___.php (where ___ is the Post Format name) and that will be used instead. |
| 37 | 37 | */ |
| 38 | - get_template_part( 'content', get_post_format() ); |
|
| 38 | + get_template_part('content', get_post_format()); |
|
| 39 | 39 | ?> |
| 40 | 40 | |
| 41 | 41 | <?php endwhile; ?> |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | <?php else : ?> |
| 46 | 46 | |
| 47 | - <?php get_template_part( 'content', 'none' ); ?> |
|
| 47 | + <?php get_template_part('content', 'none'); ?> |
|
| 48 | 48 | |
| 49 | 49 | <?php endif; $lsx_archive = 0; ?> |
| 50 | 50 | |
@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Customizer Header Swatch Control Class |
| 6 | 6 | * |
| 7 | 7 | * @since 1.0.0 |
| 8 | 8 | */ |
| 9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
| 9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
| 10 | 10 | return; |
| 11 | 11 | } |
| 12 | 12 | class LSX_Customize_Header_Layout_Control extends WP_Customize_Control { |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | * @param string $id |
| 39 | 39 | * @param array $args |
| 40 | 40 | */ |
| 41 | - public function __construct( $manager, $id, $args = array() ) { |
|
| 42 | - parent::__construct( $manager, $id, $args ); |
|
| 43 | - if( !empty( $args['choices'] ) ){ |
|
| 41 | + public function __construct($manager, $id, $args = array()) { |
|
| 42 | + parent::__construct($manager, $id, $args); |
|
| 43 | + if ( ! empty($args['choices'])) { |
|
| 44 | 44 | $this->layouts = $args['choices']; |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function enqueue() { |
| 54 | 54 | // |
| 55 | - wp_enqueue_script( 'lsx-header-layout-control', get_template_directory_uri() .'/js/customizer-header-layout.js', array('jquery'), null, true ); |
|
| 55 | + wp_enqueue_script('lsx-header-layout-control', get_template_directory_uri() . '/js/customizer-header-layout.js', array('jquery'), null, true); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -62,30 +62,30 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function render_content() { |
| 64 | 64 | |
| 65 | - $post_id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); |
|
| 65 | + $post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id)); |
|
| 66 | 66 | $class = 'customize-control customize-control-' . $this->type; |
| 67 | 67 | $value = $this->value(); |
| 68 | 68 | |
| 69 | 69 | ?> |
| 70 | 70 | <label> |
| 71 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
| 72 | - <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
|
| 71 | + <?php if ( ! empty($this->label)) { ?> |
|
| 72 | + <span class="customize-control-title"><?php echo esc_html($this->label); ?></span> |
|
| 73 | 73 | <?php } |
| 74 | - if ( ! empty( $this->description ) ) { ?> |
|
| 75 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> |
|
| 74 | + if ( ! empty($this->description)) { ?> |
|
| 75 | + <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> |
|
| 76 | 76 | <?php } ?> |
| 77 | 77 | <div class="header-layouts-selector"> |
| 78 | 78 | <?php |
| 79 | - foreach( $this->layouts as $layout ){ |
|
| 79 | + foreach ($this->layouts as $layout) { |
|
| 80 | 80 | $sel = 'border: 1px solid transparent;'; |
| 81 | - if( $value == $layout ){ |
|
| 81 | + if ($value == $layout) { |
|
| 82 | 82 | $sel = 'border: 1px solid rgb(43, 166, 203);'; |
| 83 | 83 | } |
| 84 | - echo '<img class="header-layout-button" style="padding:2px;'. esc_attr( $sel ) .'" src="' . esc_attr( get_template_directory_uri() ) .'/img/header-' . esc_attr( $layout ) . '.png" data-option="' . esc_attr( $layout ) . '">'; |
|
| 84 | + echo '<img class="header-layout-button" style="padding:2px;' . esc_attr($sel) . '" src="' . esc_attr(get_template_directory_uri()) . '/img/header-' . esc_attr($layout) . '.png" data-option="' . esc_attr($layout) . '">'; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | ?> |
| 88 | - <input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr( $class ); ?>" id="<?php echo esc_attr( $post_id ); ?>" type="hidden" value="<?php echo esc_attr( $value ); ?>" <?php $this->input_attrs(); ?>> |
|
| 88 | + <input <?php $this->link(); ?> class="selected-header-layout <?php echo esc_attr($class); ?>" id="<?php echo esc_attr($post_id); ?>" type="hidden" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> |
|
| 89 | 89 | </div> |
| 90 | 90 | </label> |
| 91 | 91 | <?php |
@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Customizer Header Fixed Class |
| 6 | 6 | * |
| 7 | 7 | * @since 1.0.0 |
| 8 | 8 | */ |
| 9 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
| 9 | +if ( ! class_exists('WP_Customize_Control')) { |
|
| 10 | 10 | return; |
| 11 | 11 | } |
| 12 | 12 | class LSX_Customize_Header_Fixed_Control extends WP_Customize_Control { |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | * @param string $id |
| 39 | 39 | * @param array $args |
| 40 | 40 | */ |
| 41 | - public function __construct( $manager, $id, $args = array() ) { |
|
| 42 | - parent::__construct( $manager, $id, $args ); |
|
| 43 | - if( !empty( $args['choices'] ) ){ |
|
| 41 | + public function __construct($manager, $id, $args = array()) { |
|
| 42 | + parent::__construct($manager, $id, $args); |
|
| 43 | + if ( ! empty($args['choices'])) { |
|
| 44 | 44 | $this->layouts = $args['choices']; |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function enqueue() { |
| 54 | 54 | // |
| 55 | - wp_enqueue_script( 'lsx-header-fixed-control', get_template_directory_uri() .'/js/customizer-header-fixed.js', array('jquery'), null, true ); |
|
| 55 | + wp_enqueue_script('lsx-header-fixed-control', get_template_directory_uri() . '/js/customizer-header-fixed.js', array('jquery'), null, true); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -62,21 +62,21 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function render_content() { |
| 64 | 64 | |
| 65 | - $post_id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); |
|
| 65 | + $post_id = 'customize-control-' . str_replace('[', '-', str_replace(']', '', $this->id)); |
|
| 66 | 66 | $class = 'customize-control customize-control-' . $this->type; |
| 67 | 67 | $value = $this->value(); |
| 68 | 68 | |
| 69 | 69 | ?> |
| 70 | 70 | <label> |
| 71 | - <?php if ( ! empty( $this->label ) ) { ?> |
|
| 72 | - <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
|
| 71 | + <?php if ( ! empty($this->label)) { ?> |
|
| 72 | + <span class="customize-control-title"><?php echo esc_html($this->label); ?></span> |
|
| 73 | 73 | <?php } |
| 74 | - if ( ! empty( $this->description ) ) { ?> |
|
| 75 | - <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span> |
|
| 74 | + if ( ! empty($this->description)) { ?> |
|
| 75 | + <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> |
|
| 76 | 76 | <?php } ?> |
| 77 | 77 | <div class="header-fixed"> |
| 78 | 78 | <label> |
| 79 | - <input <?php $this->link(); ?> type="checkbox" id="<?php echo esc_attr( $post_id ); ?>" class="header-fixed <?php echo esc_attr( $class ); ?>" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> Uncheck for standard header |
|
| 79 | + <input <?php $this->link(); ?> type="checkbox" id="<?php echo esc_attr($post_id); ?>" class="header-fixed <?php echo esc_attr($class); ?>" value="<?php echo esc_attr($value); ?>" <?php $this->input_attrs(); ?>> Uncheck for standard header |
|
| 80 | 80 | </label> |
| 81 | 81 | </div> |
| 82 | 82 | </label> |
@@ -1,42 +1,42 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * LSX_Customize_Font_Control Class |
| 6 | 6 | **/ |
| 7 | -if( !class_exists( 'WP_Customize_Control' ) ){ |
|
| 7 | +if ( ! class_exists('WP_Customize_Control')) { |
|
| 8 | 8 | return; |
| 9 | 9 | } |
| 10 | -class LSX_Customize_Font_Control extends WP_Customize_Control{ |
|
| 10 | +class LSX_Customize_Font_Control extends WP_Customize_Control { |
|
| 11 | 11 | public $fonts; |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * Enqueue the styles and scripts |
| 15 | 15 | **/ |
| 16 | - public function enqueue(){ |
|
| 16 | + public function enqueue() { |
|
| 17 | 17 | // styles |
| 18 | - wp_enqueue_style( 'lsx-font-picker-custom-control', get_template_directory_uri() .'/css/customizer-font.css'); |
|
| 18 | + wp_enqueue_style('lsx-font-picker-custom-control', get_template_directory_uri() . '/css/customizer-font.css'); |
|
| 19 | 19 | |
| 20 | 20 | // scripts |
| 21 | - wp_enqueue_script( 'lsx-font-picker-custom-control', get_template_directory_uri() .'/js/customizer-font.js'); |
|
| 21 | + wp_enqueue_script('lsx-font-picker-custom-control', get_template_directory_uri() . '/js/customizer-font.js'); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Render the content on the theme customizer page |
| 26 | 26 | **/ |
| 27 | - public function render_content(){ |
|
| 28 | - if ( empty( $this->choices ) ){ |
|
| 27 | + public function render_content() { |
|
| 28 | + if (empty($this->choices)) { |
|
| 29 | 29 | // if there are no choices then don't print anything |
| 30 | 30 | return; |
| 31 | 31 | } |
| 32 | 32 | $fonts = array(); |
| 33 | - foreach( $this->choices as $slug=>$font ){ |
|
| 33 | + foreach ($this->choices as $slug=>$font) { |
|
| 34 | 34 | $fonts[] = $font['header']; |
| 35 | 35 | $fonts[] = $font['body']; |
| 36 | 36 | $this->choices[$slug] = $font; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $this->fonts = new LSX_Google_Font_Collection( $fonts ); |
|
| 39 | + $this->fonts = new LSX_Google_Font_Collection($fonts); |
|
| 40 | 40 | |
| 41 | 41 | $fonts = $this->fonts->get_font_family_name_array(); |
| 42 | 42 | //print links to css files |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | <div class="fontPickerCustomControl"> |
| 52 | 52 | <select <?php $this->link(); ?>> |
| 53 | 53 | <?php |
| 54 | - foreach ( $this->choices as $value => $conf ){ |
|
| 55 | - echo '<option value="' . esc_attr( $value ) . '">' . esc_html( $value ) . '</option>'; |
|
| 54 | + foreach ($this->choices as $value => $conf) { |
|
| 55 | + echo '<option value="' . esc_attr($value) . '">' . esc_html($value) . '</option>'; |
|
| 56 | 56 | } |
| 57 | 57 | ?> |
| 58 | 58 | </select> |
@@ -60,16 +60,16 @@ discard block |
||
| 60 | 60 | <ul> |
| 61 | 61 | <?php |
| 62 | 62 | //$cssClassArray = $this->fonts->get_css_class_array(); |
| 63 | - foreach ($this->choices as $key => $font){ |
|
| 63 | + foreach ($this->choices as $key => $font) { |
|
| 64 | 64 | $class = null; |
| 65 | - if( $key == $set_value ){ |
|
| 65 | + if ($key == $set_value) { |
|
| 66 | 66 | $class = ' selected'; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | ?> |
| 70 | - <li class="font-choice <?php echo esc_attr( $class ); ?>"> |
|
| 71 | - <div class="<?php echo esc_attr( $font['header']['cssClass'] ); ?>"><?php echo esc_html( $font['header']['title'] ); ?></div> |
|
| 72 | - <small class="<?php echo esc_attr( $font['body']['cssClass'] ); ?>"><?php echo esc_html( $font['body']['title'] ); ?></small> |
|
| 70 | + <li class="font-choice <?php echo esc_attr($class); ?>"> |
|
| 71 | + <div class="<?php echo esc_attr($font['header']['cssClass']); ?>"><?php echo esc_html($font['header']['title']); ?></div> |
|
| 72 | + <small class="<?php echo esc_attr($font['body']['cssClass']); ?>"><?php echo esc_html($font['body']['title']); ?></small> |
|
| 73 | 73 | </li> |
| 74 | 74 | <?php |
| 75 | 75 | } |