@@ -18,11 +18,11 @@ discard block |
||
| 18 | 18 | * |
| 19 | 19 | * @return bool True if it has schema, false if not. |
| 20 | 20 | */ |
| 21 | - public static function is_type( $post_type = null, $comparison_type = null ) { |
|
| 22 | - if ( is_null( $comparison_type ) ) { |
|
| 21 | + public static function is_type($post_type = null, $comparison_type = null) { |
|
| 22 | + if (is_null($comparison_type)) { |
|
| 23 | 23 | return false; |
| 24 | 24 | } |
| 25 | - if ( is_null( $post_type ) ) { |
|
| 25 | + if (is_null($post_type)) { |
|
| 26 | 26 | $post_type = get_post_type(); |
| 27 | 27 | } |
| 28 | 28 | /** |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | * |
| 31 | 31 | * @api string[] $post_types The post types for which we output Review. |
| 32 | 32 | */ |
| 33 | - $post_types = apply_filters( 'wpseo_schema_' . $comparison_type . '_post_types', array( $comparison_type ) ); |
|
| 34 | - return in_array( $post_type, $post_types ); |
|
| 33 | + $post_types = apply_filters('wpseo_schema_' . $comparison_type . '_post_types', array($comparison_type)); |
|
| 34 | + return in_array($post_type, $post_types); |
|
| 35 | 35 | } |
| 36 | 36 | /** |
| 37 | 37 | * Retrieve a users Schema ID. |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | * |
| 43 | 43 | * @return string The user's schema ID. |
| 44 | 44 | */ |
| 45 | - public static function get_places_schema_id( $place_id, $type, $context ) { |
|
| 46 | - $url = $context->site_url . '#/schema/' . strtolower( $type ) . '/' . wp_hash( $place_id . get_the_title( $place_id ) ); |
|
| 47 | - return trailingslashit( $url ); |
|
| 45 | + public static function get_places_schema_id($place_id, $type, $context) { |
|
| 46 | + $url = $context->site_url . '#/schema/' . strtolower($type) . '/' . wp_hash($place_id . get_the_title($place_id)); |
|
| 47 | + return trailingslashit($url); |
|
| 48 | 48 | } |
| 49 | 49 | /** |
| 50 | 50 | * Retrieve a users Schema ID. |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | * |
| 55 | 55 | * @return string The user's schema ID. |
| 56 | 56 | */ |
| 57 | - public static function get_subtrip_schema_id( $name, $context ) { |
|
| 58 | - $url = $context->site_url . '#/subtrip/' . wp_hash( $name . $context->id ); |
|
| 59 | - return trailingslashit( $url ); |
|
| 57 | + public static function get_subtrip_schema_id($name, $context) { |
|
| 58 | + $url = $context->site_url . '#/subtrip/' . wp_hash($name . $context->id); |
|
| 59 | + return trailingslashit($url); |
|
| 60 | 60 | } |
| 61 | 61 | /** |
| 62 | 62 | * Retrieve an offer Schema ID. |
@@ -67,15 +67,15 @@ discard block |
||
| 67 | 67 | * |
| 68 | 68 | * @return string The user's schema ID. |
| 69 | 69 | */ |
| 70 | - public static function get_offer_schema_id( $id, $context, $local = false ) { |
|
| 71 | - if ( false === $local ) { |
|
| 70 | + public static function get_offer_schema_id($id, $context, $local = false) { |
|
| 71 | + if (false === $local) { |
|
| 72 | 72 | $url = $context->site_url; |
| 73 | 73 | } else { |
| 74 | - $url = get_permalink( $context->id ); |
|
| 74 | + $url = get_permalink($context->id); |
|
| 75 | 75 | } |
| 76 | 76 | $url .= '#/schema/offer/'; |
| 77 | - $url .= wp_hash( $id . get_the_title( $id ) ); |
|
| 78 | - return trailingslashit( $url ); |
|
| 77 | + $url .= wp_hash($id . get_the_title($id)); |
|
| 78 | + return trailingslashit($url); |
|
| 79 | 79 | } |
| 80 | 80 | /** |
| 81 | 81 | * Retrieve an review Schema ID. |
@@ -86,15 +86,15 @@ discard block |
||
| 86 | 86 | * |
| 87 | 87 | * @return string The user's schema ID. |
| 88 | 88 | */ |
| 89 | - public static function get_review_schema_id( $id, $context, $local = false ) { |
|
| 90 | - if ( false === $local ) { |
|
| 89 | + public static function get_review_schema_id($id, $context, $local = false) { |
|
| 90 | + if (false === $local) { |
|
| 91 | 91 | $url = $context->site_url; |
| 92 | 92 | } else { |
| 93 | - $url = get_permalink( $context->id ); |
|
| 93 | + $url = get_permalink($context->id); |
|
| 94 | 94 | } |
| 95 | 95 | $url .= '#/schema/review/'; |
| 96 | - $url .= wp_hash( $id . get_the_title( $id ) ); |
|
| 97 | - return trailingslashit( $url ); |
|
| 96 | + $url .= wp_hash($id . get_the_title($id)); |
|
| 97 | + return trailingslashit($url); |
|
| 98 | 98 | } |
| 99 | 99 | /** |
| 100 | 100 | * Retrieve an Article Schema ID. |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | * |
| 106 | 106 | * @return string The user's schema ID. |
| 107 | 107 | */ |
| 108 | - public static function get_article_schema_id( $id, $context, $local = false ) { |
|
| 109 | - if ( false === $local ) { |
|
| 110 | - $url = get_permalink( $id ) . \WPSEO_Schema_IDs::ARTICLE_HASH; |
|
| 108 | + public static function get_article_schema_id($id, $context, $local = false) { |
|
| 109 | + if (false === $local) { |
|
| 110 | + $url = get_permalink($id) . \WPSEO_Schema_IDs::ARTICLE_HASH; |
|
| 111 | 111 | } else { |
| 112 | - $url = get_permalink( $context->id ) . '#/schema/article/' . wp_hash( $id . get_the_title( $id ) ); |
|
| 112 | + $url = get_permalink($context->id) . '#/schema/article/' . wp_hash($id . get_the_title($id)); |
|
| 113 | 113 | } |
| 114 | - return trailingslashit( $url ); |
|
| 114 | + return trailingslashit($url); |
|
| 115 | 115 | } |
| 116 | 116 | /** |
| 117 | 117 | * Retrieve a users Schema ID. |
@@ -121,8 +121,8 @@ discard block |
||
| 121 | 121 | * |
| 122 | 122 | * @return string The user's schema ID. |
| 123 | 123 | */ |
| 124 | - public static function get_author_schema_id( $name, $email, $context ) { |
|
| 125 | - return $context->site_url . \WPSEO_Schema_IDs::PERSON_HASH . wp_hash( $name . $email ); |
|
| 124 | + public static function get_author_schema_id($name, $email, $context) { |
|
| 125 | + return $context->site_url . \WPSEO_Schema_IDs::PERSON_HASH . wp_hash($name . $email); |
|
| 126 | 126 | } |
| 127 | 127 | /** |
| 128 | 128 | * Generates the place graph piece for the subtrip / Itinerary arrays. |
@@ -135,16 +135,16 @@ discard block |
||
| 135 | 135 | * |
| 136 | 136 | * @return mixed array $data Place data. |
| 137 | 137 | */ |
| 138 | - public static function add_place( $data, $type, $post_id, $context, $contained_in = false ) { |
|
| 139 | - $at_id = self::get_places_schema_id( $post_id, $type, $context ); |
|
| 138 | + public static function add_place($data, $type, $post_id, $context, $contained_in = false) { |
|
| 139 | + $at_id = self::get_places_schema_id($post_id, $type, $context); |
|
| 140 | 140 | $place = array( |
| 141 | 141 | '@type' => $type, |
| 142 | 142 | '@id' => $at_id, |
| 143 | - 'name' => get_the_title( $post_id ), |
|
| 144 | - 'description' => get_the_excerpt( $post_id ), |
|
| 145 | - 'url' => get_permalink( $post_id ), |
|
| 143 | + 'name' => get_the_title($post_id), |
|
| 144 | + 'description' => get_the_excerpt($post_id), |
|
| 145 | + 'url' => get_permalink($post_id), |
|
| 146 | 146 | ); |
| 147 | - if ( false !== $contained_in ) { |
|
| 147 | + if (false !== $contained_in) { |
|
| 148 | 148 | $place['containedInPlace'] = array( |
| 149 | 149 | '@type' => 'Country', |
| 150 | 150 | '@id' => $contained_in, |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | * |
| 162 | 162 | * @return array $data The Review data. |
| 163 | 163 | */ |
| 164 | - public static function add_image( $data, $context ) { |
|
| 165 | - if ( $context->has_image ) { |
|
| 164 | + public static function add_image($data, $context) { |
|
| 165 | + if ($context->has_image) { |
|
| 166 | 166 | $data['image'] = array( |
| 167 | 167 | '@id' => $context->canonical . \WPSEO_Schema_IDs::PRIMARY_IMAGE_HASH, |
| 168 | 168 | ); |
@@ -176,18 +176,18 @@ discard block |
||
| 176 | 176 | * @param string $type The schema type. |
| 177 | 177 | * @return array $schema An array of the schema markup. |
| 178 | 178 | */ |
| 179 | - public static function get_item_reviewed( $items = array(), $type = '' ) { |
|
| 179 | + public static function get_item_reviewed($items = array(), $type = '') { |
|
| 180 | 180 | $schema = array(); |
| 181 | - if ( false !== $items && ! empty( $items ) && '' !== $type ) { |
|
| 182 | - array_unique( $items ); |
|
| 183 | - foreach ( $items as $item ) { |
|
| 184 | - $title = get_the_title( $item ); |
|
| 185 | - if ( '' !== $title ) { |
|
| 181 | + if (false !== $items && ! empty($items) && '' !== $type) { |
|
| 182 | + array_unique($items); |
|
| 183 | + foreach ($items as $item) { |
|
| 184 | + $title = get_the_title($item); |
|
| 185 | + if ('' !== $title) { |
|
| 186 | 186 | $item_schema = array( |
| 187 | 187 | '@type' => $type, |
| 188 | 188 | 'name' => $title, |
| 189 | 189 | ); |
| 190 | - $schema[] = $item_schema; |
|
| 190 | + $schema[] = $item_schema; |
|
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | } |
@@ -203,18 +203,18 @@ discard block |
||
| 203 | 203 | * |
| 204 | 204 | * @return mixed array $data Review data. |
| 205 | 205 | */ |
| 206 | - public static function add_terms( $data, $post_id, $key, $taxonomy ) { |
|
| 207 | - $terms = get_the_terms( $post_id, $taxonomy ); |
|
| 208 | - if ( is_array( $terms ) ) { |
|
| 206 | + public static function add_terms($data, $post_id, $key, $taxonomy) { |
|
| 207 | + $terms = get_the_terms($post_id, $taxonomy); |
|
| 208 | + if (is_array($terms)) { |
|
| 209 | 209 | $keywords = array(); |
| 210 | - foreach ( $terms as $term ) { |
|
| 210 | + foreach ($terms as $term) { |
|
| 211 | 211 | // We are checking against the WordPress internal translation. |
| 212 | 212 | // @codingStandardsIgnoreLine |
| 213 | - if ( __( 'Uncategorized', 'lsx' ) !== $term->name ) { |
|
| 213 | + if (__('Uncategorized', 'lsx') !== $term->name) { |
|
| 214 | 214 | $keywords[] = $term->name; |
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | - $data[ $key ] = implode( ',', $keywords ); |
|
| 217 | + $data[$key] = implode(',', $keywords); |
|
| 218 | 218 | } |
| 219 | 219 | return $data; |
| 220 | 220 | } |
@@ -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,18 +17,18 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | <?php lsx_content_top(); ?> |
| 19 | 19 | |
| 20 | - <?php if ( have_posts() ) : ?> |
|
| 20 | + <?php if (have_posts()) : ?> |
|
| 21 | 21 | |
| 22 | 22 | <?php |
| 23 | - while ( have_posts() ) : |
|
| 23 | + while (have_posts()) : |
|
| 24 | 24 | the_post(); |
| 25 | 25 | ?> |
| 26 | 26 | |
| 27 | 27 | <?php |
| 28 | - if ( is_singular( 'post' ) ) { |
|
| 29 | - get_template_part( 'partials/content', 'post' ); |
|
| 28 | + if (is_singular('post')) { |
|
| 29 | + get_template_part('partials/content', 'post'); |
|
| 30 | 30 | } else { |
| 31 | - get_template_part( 'partials/content', 'custom' ); |
|
| 31 | + get_template_part('partials/content', 'custom'); |
|
| 32 | 32 | } |
| 33 | 33 | ?> |
| 34 | 34 | |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | <?php lsx_content_after(); ?> |
| 44 | 44 | |
| 45 | 45 | <?php |
| 46 | - if ( is_singular( 'post' ) ) { |
|
| 46 | + if (is_singular('post')) { |
|
| 47 | 47 | lsx_post_nav(); |
| 48 | 48 | } |
| 49 | 49 | ?> |
| 50 | 50 | |
| 51 | 51 | <?php |
| 52 | - if ( comments_open() ) { |
|
| 52 | + if (comments_open()) { |
|
| 53 | 53 | comments_template(); |
| 54 | 54 | } |
| 55 | 55 | ?> |
@@ -20,14 +20,14 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | <?php lsx_content_top(); ?> |
| 22 | 22 | |
| 23 | - <?php if ( have_posts() ) : ?> |
|
| 23 | + <?php if (have_posts()) : ?> |
|
| 24 | 24 | |
| 25 | 25 | <?php |
| 26 | - while ( have_posts() ) : |
|
| 26 | + while (have_posts()) : |
|
| 27 | 27 | the_post(); |
| 28 | 28 | ?> |
| 29 | 29 | |
| 30 | - <?php get_template_part( 'partials/content', 'page' ); ?> |
|
| 30 | + <?php get_template_part('partials/content', 'page'); ?> |
|
| 31 | 31 | |
| 32 | 32 | <?php endwhile; ?> |
| 33 | 33 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | <?php lsx_content_bottom(); ?> |
| 37 | 37 | |
| 38 | 38 | <?php |
| 39 | - if ( comments_open() ) { |
|
| 39 | + if (comments_open()) { |
|
| 40 | 40 | comments_template(); |
| 41 | 41 | } |
| 42 | 42 | ?> |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | <?php lsx_content_wrap_before(); ?> |
| 14 | 14 | |
| 15 | -<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
| 15 | +<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
| 16 | 16 | |
| 17 | 17 | <?php lsx_content_before(); ?> |
| 18 | 18 | |
@@ -20,10 +20,10 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | <?php lsx_content_top(); ?> |
| 22 | 22 | |
| 23 | - <?php if ( have_posts() ) : ?> |
|
| 23 | + <?php if (have_posts()) : ?> |
|
| 24 | 24 | |
| 25 | 25 | <?php |
| 26 | - while ( have_posts() ) : |
|
| 26 | + while (have_posts()) : |
|
| 27 | 27 | the_post(); |
| 28 | 28 | ?> |
| 29 | 29 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | <?php lsx_content_wrap_after(); ?> |
| 59 | 59 | |
| 60 | -<?php get_sidebar( 'sitemap' ); ?> |
|
| 60 | +<?php get_sidebar('sitemap'); ?> |
|
| 61 | 61 | |
| 62 | 62 | <?php |
| 63 | 63 | get_footer(); |
@@ -20,10 +20,10 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | <?php lsx_content_top(); ?> |
| 22 | 22 | |
| 23 | - <?php if ( ( have_posts() && ! class_exists( 'LSX_Banners' ) || ( function_exists( 'has_blocks' ) && has_blocks() ) ) ) : ?> |
|
| 23 | + <?php if ((have_posts() && ! class_exists('LSX_Banners') || (function_exists('has_blocks') && has_blocks()))) : ?> |
|
| 24 | 24 | |
| 25 | 25 | <?php |
| 26 | - while ( have_posts() ) : |
|
| 26 | + while (have_posts()) : |
|
| 27 | 27 | the_post(); |
| 28 | 28 | ?> |
| 29 | 29 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | <?php |
| 38 | 38 | wp_link_pages( |
| 39 | 39 | array( |
| 40 | - 'before' => '<nav class="page-nav"><p>' . esc_html__( 'Pages:', 'lsx' ), |
|
| 40 | + 'before' => '<nav class="page-nav"><p>' . esc_html__('Pages:', 'lsx'), |
|
| 41 | 41 | 'after' => '</p></nav>', |
| 42 | 42 | ) |
| 43 | 43 | ); |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | <?php endif; ?> |
| 54 | 54 | |
| 55 | - <?php if ( is_active_sidebar( 'sidebar-home' ) ) : ?> |
|
| 55 | + <?php if (is_active_sidebar('sidebar-home')) : ?> |
|
| 56 | 56 | |
| 57 | 57 | <div id="home-widgets"> |
| 58 | 58 | |
| 59 | - <?php dynamic_sidebar( 'sidebar-home' ); ?> |
|
| 59 | + <?php dynamic_sidebar('sidebar-home'); ?> |
|
| 60 | 60 | |
| 61 | 61 | </div> |
| 62 | 62 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | <?php lsx_content_wrap_before(); ?> |
| 14 | 14 | |
| 15 | -<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>"> |
|
| 15 | +<div id="primary" class="content-area <?php echo esc_attr(lsx_main_class()); ?>"> |
|
| 16 | 16 | |
| 17 | 17 | <?php lsx_content_before(); ?> |
| 18 | 18 | |
@@ -20,10 +20,10 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | <?php lsx_content_top(); ?> |
| 22 | 22 | |
| 23 | - <?php if ( have_posts() ) : ?> |
|
| 23 | + <?php if (have_posts()) : ?> |
|
| 24 | 24 | |
| 25 | 25 | <?php |
| 26 | - while ( have_posts() ) : |
|
| 26 | + while (have_posts()) : |
|
| 27 | 27 | the_post(); |
| 28 | 28 | ?> |
| 29 | 29 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | <?php lsx_entry_top(); ?> |
| 35 | 35 | |
| 36 | 36 | <div class="entry-content"> |
| 37 | - <h2><?php esc_html_e( 'The Last 30 Posts', 'lsx' ); ?></h2> |
|
| 37 | + <h2><?php esc_html_e('The Last 30 Posts', 'lsx'); ?></h2> |
|
| 38 | 38 | |
| 39 | 39 | <ul> |
| 40 | 40 | <?php |
@@ -45,16 +45,16 @@ discard block |
||
| 45 | 45 | ); |
| 46 | 46 | ?> |
| 47 | 47 | |
| 48 | - <?php if ( $loop->have_posts() ) : ?> |
|
| 48 | + <?php if ($loop->have_posts()) : ?> |
|
| 49 | 49 | |
| 50 | - <?php while ( $loop->have_posts() ) : ?> |
|
| 50 | + <?php while ($loop->have_posts()) : ?> |
|
| 51 | 51 | |
| 52 | 52 | <?php |
| 53 | 53 | $loop->the_post(); |
| 54 | 54 | $loop->is_home = false; |
| 55 | 55 | ?> |
| 56 | 56 | |
| 57 | - <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> - <?php the_time( get_option( 'date_format' ) ); ?> - <?php echo esc_html( $post->comment_count ); ?> <?php esc_html_e( 'comments', 'lsx' ); ?></li> |
|
| 57 | + <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> - <?php the_time(get_option('date_format')); ?> - <?php echo esc_html($post->comment_count); ?> <?php esc_html_e('comments', 'lsx'); ?></li> |
|
| 58 | 58 | |
| 59 | 59 | <?php endwhile; ?> |
| 60 | 60 | |
@@ -63,16 +63,16 @@ discard block |
||
| 63 | 63 | <?php wp_reset_postdata(); ?> |
| 64 | 64 | </ul> |
| 65 | 65 | |
| 66 | - <h2><?php esc_html_e( 'Categories', 'lsx' ); ?></h2> |
|
| 66 | + <h2><?php esc_html_e('Categories', 'lsx'); ?></h2> |
|
| 67 | 67 | |
| 68 | 68 | <ul> |
| 69 | - <?php wp_list_categories( 'title_li=&hierarchical=0&show_count=1' ); ?> |
|
| 69 | + <?php wp_list_categories('title_li=&hierarchical=0&show_count=1'); ?> |
|
| 70 | 70 | </ul> |
| 71 | 71 | |
| 72 | - <h2><?php esc_html_e( 'Monthly Archives', 'lsx' ); ?></h2> |
|
| 72 | + <h2><?php esc_html_e('Monthly Archives', 'lsx'); ?></h2> |
|
| 73 | 73 | |
| 74 | 74 | <ul> |
| 75 | - <?php wp_get_archives( 'type=monthly&show_post_count=1' ); ?> |
|
| 75 | + <?php wp_get_archives('type=monthly&show_post_count=1'); ?> |
|
| 76 | 76 | </ul> |
| 77 | 77 | </div><!-- .entry-content --> |
| 78 | 78 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | <?php lsx_entry_before(); ?> |
| 11 | 11 | |
| 12 | 12 | <?php |
| 13 | - $no_thumb_post_types = array( |
|
| 13 | + $no_thumb_post_types = array( |
|
| 14 | 14 | 'audio' => 'audio', |
| 15 | 15 | 'gallery' => 'gallery', |
| 16 | 16 | 'image' => 'image', |
@@ -18,38 +18,38 @@ discard block |
||
| 18 | 18 | 'quote' => 'quote', |
| 19 | 19 | 'video' => 'video', |
| 20 | 20 | ); |
| 21 | - $no_thumb_post_formats = apply_filters( 'lsx_no_thumb_post_formats', $no_thumb_post_types ); |
|
| 21 | + $no_thumb_post_formats = apply_filters('lsx_no_thumb_post_formats', $no_thumb_post_types); |
|
| 22 | 22 | |
| 23 | - $has_thumb = has_post_thumbnail() && ! has_post_format( $no_thumb_post_formats ); |
|
| 23 | + $has_thumb = has_post_thumbnail() && ! has_post_format($no_thumb_post_formats); |
|
| 24 | 24 | |
| 25 | - if ( $has_thumb ) { |
|
| 25 | + if ($has_thumb) { |
|
| 26 | 26 | $thumb_class = 'has-thumb'; |
| 27 | 27 | } else { |
| 28 | 28 | $thumb_class = 'no-thumb'; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - $blog_layout = apply_filters( 'lsx_blog_layout', 'default' ); |
|
| 31 | + $blog_layout = apply_filters('lsx_blog_layout', 'default'); |
|
| 32 | 32 | |
| 33 | 33 | $image_class = ''; |
| 34 | 34 | |
| 35 | - $thumbnail_id = get_post_thumbnail_id( get_the_ID() ); |
|
| 36 | - $image_arr = wp_get_attachment_image_src( $thumbnail_id, 'lsx-thumbnail-single' ); |
|
| 35 | + $thumbnail_id = get_post_thumbnail_id(get_the_ID()); |
|
| 36 | + $image_arr = wp_get_attachment_image_src($thumbnail_id, 'lsx-thumbnail-single'); |
|
| 37 | 37 | |
| 38 | - if ( is_array( $image_arr ) ) { |
|
| 38 | + if (is_array($image_arr)) { |
|
| 39 | 39 | $image_src = $image_arr[0]; |
| 40 | 40 | } |
| 41 | 41 | ?> |
| 42 | 42 | |
| 43 | -<article id="post-<?php the_ID(); ?>" <?php post_class( array( 'lsx-slot', $thumb_class ) ); ?>> |
|
| 43 | +<article id="post-<?php the_ID(); ?>" <?php post_class(array('lsx-slot', $thumb_class)); ?>> |
|
| 44 | 44 | <?php lsx_entry_top(); ?> |
| 45 | 45 | |
| 46 | 46 | <div class="entry-layout"> |
| 47 | 47 | <div class="entry-layout-content entry-layout-content-<?php echo has_post_thumbnail() ? '67' : '100'; ?>"> |
| 48 | 48 | <header class="entry-header"> |
| 49 | - <?php if ( $has_thumb ) : ?> |
|
| 50 | - <div class="entry-image <?php echo esc_attr( $image_class ); ?>"> |
|
| 49 | + <?php if ($has_thumb) : ?> |
|
| 50 | + <div class="entry-image <?php echo esc_attr($image_class); ?>"> |
|
| 51 | 51 | <a class="thumbnail" href="<?php the_permalink(); ?>"> |
| 52 | - <?php lsx_thumbnail( 'lsx-thumbnail-single' ); ?> |
|
| 52 | + <?php lsx_thumbnail('lsx-thumbnail-single'); ?> |
|
| 53 | 53 | </a> |
| 54 | 54 | </div> |
| 55 | 55 | <?php endif; ?> |
@@ -57,37 +57,37 @@ discard block |
||
| 57 | 57 | <?php |
| 58 | 58 | $format = get_post_format(); |
| 59 | 59 | |
| 60 | - if ( false === $format ) { |
|
| 60 | + if (false === $format) { |
|
| 61 | 61 | $format = 'standard'; |
| 62 | - $show_on_front = get_option( 'show_on_front', 'posts' ); |
|
| 62 | + $show_on_front = get_option('show_on_front', 'posts'); |
|
| 63 | 63 | |
| 64 | - if ( 'page' === $show_on_front ) { |
|
| 65 | - $archive_link = get_permalink( get_option( 'page_for_posts' ) ); |
|
| 64 | + if ('page' === $show_on_front) { |
|
| 65 | + $archive_link = get_permalink(get_option('page_for_posts')); |
|
| 66 | 66 | } else { |
| 67 | 67 | $archive_link = home_url(); |
| 68 | 68 | } |
| 69 | 69 | } else { |
| 70 | - $archive_link = get_post_format_link( $format ); |
|
| 70 | + $archive_link = get_post_format_link($format); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - $format = lsx_translate_format_to_fontawesome( $format ); |
|
| 73 | + $format = lsx_translate_format_to_fontawesome($format); |
|
| 74 | 74 | ?> |
| 75 | 75 | |
| 76 | 76 | <h2 class="entry-title"> |
| 77 | - <?php if ( has_post_thumbnail() ) : ?> |
|
| 78 | - <a href="<?php echo esc_url( $archive_link ); ?>" class="format-link has-thumb fa fa-<?php echo esc_attr( $format ); ?>"></a> |
|
| 77 | + <?php if (has_post_thumbnail()) : ?> |
|
| 78 | + <a href="<?php echo esc_url($archive_link); ?>" class="format-link has-thumb fa fa-<?php echo esc_attr($format); ?>"></a> |
|
| 79 | 79 | <?php else : ?> |
| 80 | - <a href="<?php echo esc_url( $archive_link ); ?>" class="format-link fa fa-<?php echo esc_attr( $format ); ?>"></a> |
|
| 80 | + <a href="<?php echo esc_url($archive_link); ?>" class="format-link fa fa-<?php echo esc_attr($format); ?>"></a> |
|
| 81 | 81 | <?php endif; ?> |
| 82 | 82 | |
| 83 | - <?php if ( has_post_format( array( 'link' ) ) ) : ?> |
|
| 84 | - <a href="<?php echo esc_url( lsx_get_my_url() ); ?>" rel="bookmark"><?php the_title(); ?> <span class="fa fa-external-link"></span></a> |
|
| 83 | + <?php if (has_post_format(array('link'))) : ?> |
|
| 84 | + <a href="<?php echo esc_url(lsx_get_my_url()); ?>" rel="bookmark"><?php the_title(); ?> <span class="fa fa-external-link"></span></a> |
|
| 85 | 85 | <?php else : ?> |
| 86 | 86 | <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> |
| 87 | 87 | <?php endif; ?> |
| 88 | 88 | |
| 89 | - <?php if ( is_sticky() ) : ?> |
|
| 90 | - <span class="label label-default label-sticky"><?php esc_html_e( 'Featured', 'lsx' ); ?></span> |
|
| 89 | + <?php if (is_sticky()) : ?> |
|
| 90 | + <span class="label label-default label-sticky"><?php esc_html_e('Featured', 'lsx'); ?></span> |
|
| 91 | 91 | <?php endif; ?> |
| 92 | 92 | </h2> |
| 93 | 93 | <div class="entry-meta"> |
@@ -98,27 +98,27 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | </header><!-- .entry-header --> |
| 100 | 100 | |
| 101 | - <?php if ( has_post_format( array( 'quote' ) ) || apply_filters( 'lsx_blog_display_text_on_list', true ) ) : ?> |
|
| 101 | + <?php if (has_post_format(array('quote')) || apply_filters('lsx_blog_display_text_on_list', true)) : ?> |
|
| 102 | 102 | |
| 103 | - <?php if ( lsx_post_format_force_content_on_list() && ! apply_filters( 'lsx_blog_force_content_on_list', false ) ) : ?> |
|
| 103 | + <?php if (lsx_post_format_force_content_on_list() && ! apply_filters('lsx_blog_force_content_on_list', false)) : ?> |
|
| 104 | 104 | |
| 105 | 105 | <div class="entry-summary"> |
| 106 | 106 | <?php |
| 107 | - if ( ! has_excerpt() ) { |
|
| 107 | + if ( ! has_excerpt()) { |
|
| 108 | 108 | |
| 109 | - $excerpt_more = '<p><a class="moretag" href="' . esc_url( get_permalink() ) . '">' . esc_html__( 'Read More', 'lsx' ) . '</a></p>'; |
|
| 110 | - $content = wp_trim_words( get_the_content(), 50 ); |
|
| 109 | + $excerpt_more = '<p><a class="moretag" href="' . esc_url(get_permalink()) . '">' . esc_html__('Read More', 'lsx') . '</a></p>'; |
|
| 110 | + $content = wp_trim_words(get_the_content(), 50); |
|
| 111 | 111 | $content = '<p>' . $content . '</p>' . $excerpt_more; |
| 112 | - echo wp_kses_post( $content ); |
|
| 112 | + echo wp_kses_post($content); |
|
| 113 | 113 | } else { |
| 114 | 114 | the_excerpt(); |
| 115 | 115 | } |
| 116 | 116 | ?> |
| 117 | 117 | </div><!-- .entry-summary --> |
| 118 | 118 | |
| 119 | - <?php elseif ( has_post_format( array( 'link' ) ) ) : ?> |
|
| 119 | + <?php elseif (has_post_format(array('link'))) : ?> |
|
| 120 | 120 | |
| 121 | - <?php elseif ( apply_filters( 'lsx_blog_force_content_on_list', false ) ) : ?> |
|
| 121 | + <?php elseif (apply_filters('lsx_blog_force_content_on_list', false)) : ?> |
|
| 122 | 122 | |
| 123 | 123 | <div class="entry-content"> |
| 124 | 124 | <?php the_content(); ?> |
@@ -130,12 +130,12 @@ discard block |
||
| 130 | 130 | <?php |
| 131 | 131 | the_content(); |
| 132 | 132 | |
| 133 | - wp_link_pages( array( |
|
| 133 | + wp_link_pages(array( |
|
| 134 | 134 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
| 135 | 135 | 'after' => '</div></div>', |
| 136 | 136 | 'link_before' => '<span>', |
| 137 | 137 | 'link_after' => '</span>', |
| 138 | - ) ); |
|
| 138 | + )); |
|
| 139 | 139 | ?> |
| 140 | 140 | </div><!-- .entry-content --> |
| 141 | 141 | |
@@ -151,23 +151,23 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | <?php lsx_content_post_tags(); ?> |
| 153 | 153 | |
| 154 | - <?php if ( comments_open() && ! empty( $comments_number ) ) : ?> |
|
| 154 | + <?php if (comments_open() && ! empty($comments_number)) : ?> |
|
| 155 | 155 | <div class="post-comments"> |
| 156 | 156 | <a href="<?php the_permalink(); ?>#comments"> |
| 157 | 157 | <?php |
| 158 | - if ( '1' === $comments_number ) { |
|
| 159 | - echo esc_html_x( 'One Comment', 'content.php', 'lsx' ); |
|
| 158 | + if ('1' === $comments_number) { |
|
| 159 | + echo esc_html_x('One Comment', 'content.php', 'lsx'); |
|
| 160 | 160 | } else { |
| 161 | 161 | printf( |
| 162 | 162 | /* Translators: %s: number of comments */ |
| 163 | - esc_html( _nx( |
|
| 163 | + esc_html(_nx( |
|
| 164 | 164 | '%s Comment', |
| 165 | 165 | '%s Comments', |
| 166 | 166 | $comments_number, |
| 167 | 167 | 'content.php', |
| 168 | 168 | 'lsx' |
| 169 | - ) ), |
|
| 170 | - esc_html( number_format_i18n( $comments_number ) ) |
|
| 169 | + )), |
|
| 170 | + esc_html(number_format_i18n($comments_number)) |
|
| 171 | 171 | ); |
| 172 | 172 | } |
| 173 | 173 | ?> |
@@ -177,11 +177,11 @@ discard block |
||
| 177 | 177 | </div> |
| 178 | 178 | </div> |
| 179 | 179 | |
| 180 | - <?php if ( has_post_thumbnail() ) : ?> |
|
| 180 | + <?php if (has_post_thumbnail()) : ?> |
|
| 181 | 181 | |
| 182 | 182 | <div class="entry-image hidden-xs"> |
| 183 | - <a class="thumbnail" href="<?php the_permalink(); ?>" style="background-image:url(<?php echo esc_url( $image_src ); ?>);"> |
|
| 184 | - <?php lsx_thumbnail( 'lsx-thumbnail-single' ); ?> |
|
| 183 | + <a class="thumbnail" href="<?php the_permalink(); ?>" style="background-image:url(<?php echo esc_url($image_src); ?>);"> |
|
| 184 | + <?php lsx_thumbnail('lsx-thumbnail-single'); ?> |
|
| 185 | 185 | </a> |
| 186 | 186 | </div> |
| 187 | 187 | |
@@ -17,31 +17,31 @@ |
||
| 17 | 17 | <?php |
| 18 | 18 | the_content(); |
| 19 | 19 | |
| 20 | - wp_link_pages( array( |
|
| 20 | + wp_link_pages(array( |
|
| 21 | 21 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
| 22 | 22 | 'after' => '</div></div>', |
| 23 | 23 | 'link_before' => '<span>', |
| 24 | 24 | 'link_after' => '</span>', |
| 25 | - ) ); |
|
| 25 | + )); |
|
| 26 | 26 | ?> |
| 27 | 27 | </div><!-- .entry-content --> |
| 28 | 28 | |
| 29 | 29 | <footer class="footer-meta clearfix"> |
| 30 | - <?php if ( has_tag() || class_exists( 'LSX_Sharing' ) || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) : ?> |
|
| 30 | + <?php if (has_tag() || class_exists('LSX_Sharing') || (function_exists('sharing_display') || class_exists('Jetpack_Likes'))) : ?> |
|
| 31 | 31 | <div class="post-tags-wrapper"> |
| 32 | 32 | <?php lsx_content_post_tags(); ?> |
| 33 | 33 | |
| 34 | 34 | <?php |
| 35 | - if ( class_exists( 'LSX_Sharing' ) ) { |
|
| 35 | + if (class_exists('LSX_Sharing')) { |
|
| 36 | 36 | lsx_content_sharing(); |
| 37 | 37 | } else { |
| 38 | - if ( function_exists( 'sharing_display' ) ) { |
|
| 39 | - sharing_display( '', true ); |
|
| 38 | + if (function_exists('sharing_display')) { |
|
| 39 | + sharing_display('', true); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
| 42 | + if (class_exists('Jetpack_Likes')) { |
|
| 43 | 43 | $custom_likes = new Jetpack_Likes(); |
| 44 | - echo wp_kses_post( $custom_likes->post_likes( '' ) ); |
|
| 44 | + echo wp_kses_post($custom_likes->post_likes('')); |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | ?> |
@@ -20,14 +20,14 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | <?php lsx_content_top(); ?> |
| 22 | 22 | |
| 23 | - <?php if ( have_posts() ) : ?> |
|
| 23 | + <?php if (have_posts()) : ?> |
|
| 24 | 24 | |
| 25 | 25 | <?php |
| 26 | - while ( have_posts() ) : |
|
| 26 | + while (have_posts()) : |
|
| 27 | 27 | the_post(); |
| 28 | 28 | ?> |
| 29 | 29 | |
| 30 | - <?php get_template_part( 'partials/content', 'page' ); ?> |
|
| 30 | + <?php get_template_part('partials/content', 'page'); ?> |
|
| 31 | 31 | |
| 32 | 32 | <?php endwhile; ?> |
| 33 | 33 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | <?php lsx_content_bottom(); ?> |
| 37 | 37 | |
| 38 | 38 | <?php |
| 39 | - if ( comments_open() ) { |
|
| 39 | + if (comments_open()) { |
|
| 40 | 40 | comments_template(); |
| 41 | 41 | } |
| 42 | 42 | ?> |