@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * called content-___.php (where ___ is the Post Format name) and that will be used instead. |
| 35 | 35 | */ |
| 36 | 36 | get_template_part( 'templates/loop/content', get_post_format() ); |
| 37 | - endwhile; ?> |
|
| 37 | + endwhile; ?> |
|
| 38 | 38 | </div> |
| 39 | 39 | </div> |
| 40 | 40 | </div> |
@@ -10,8 +10,8 @@ |
||
| 10 | 10 | // Exit if accessed directly. |
| 11 | 11 | defined( 'ABSPATH' ) || exit; |
| 12 | 12 | |
| 13 | -if (!is_front_page() && function_exists('yoast_breadcrumb')) { |
|
| 14 | - yoast_breadcrumb('<div id="breadcrumbs">', '</div>'); |
|
| 13 | +if ( ! is_front_page() && function_exists( 'yoast_breadcrumb' ) ) { |
|
| 14 | + yoast_breadcrumb( '<div id="breadcrumbs">', '</div>' ); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | if ( have_posts() ) : ?> |
@@ -39,6 +39,8 @@ |
||
| 39 | 39 | </div> |
| 40 | 40 | </div> |
| 41 | 41 | <?php |
| 42 | -else : |
|
| 42 | +else { |
|
| 43 | + : |
|
| 43 | 44 | get_template_part( 'templates/loop/content', 'none' ); |
| 45 | +} |
|
| 44 | 46 | endif; |
@@ -38,8 +38,10 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | get_template_part( 'templates/loop/content', get_post_format() ); |
| 40 | 40 | endwhile; |
| 41 | - else : |
|
| 41 | + else { |
|
| 42 | + : |
|
| 42 | 43 | get_template_part( 'templates/loop/content', 'none' ); |
| 44 | + } |
|
| 43 | 45 | endif; |
| 44 | 46 | ?> |
| 45 | 47 | </div> |
@@ -182,15 +182,15 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | function bg($img, $size = '', $echo = true, $additional_style = '') { |
| 184 | 184 | if ( ! $img ) { |
| 185 | - $uploads = wp_get_upload_dir(); |
|
| 186 | - $url = $uploads['baseurl'] . '/path_to_fallback_image.png'; // default placeholder image |
|
| 185 | + $uploads = wp_get_upload_dir(); |
|
| 186 | + $url = $uploads['baseurl'] . '/path_to_fallback_image.png'; // default placeholder image |
|
| 187 | 187 | } else { |
| 188 | - if ( is_array( $img ) ) { |
|
| 189 | - $url = $size ? $img['sizes'][ $size ] : $img['url']; |
|
| 190 | - } else { |
|
| 191 | - $url = $img; |
|
| 192 | - } |
|
| 193 | - } |
|
| 188 | + if ( is_array( $img ) ) { |
|
| 189 | + $url = $size ? $img['sizes'][ $size ] : $img['url']; |
|
| 190 | + } else { |
|
| 191 | + $url = $img; |
|
| 192 | + } |
|
| 193 | + } |
|
| 194 | 194 | |
| 195 | 195 | /*if (strpos($_SERVER['HTTP_ACCEPT'], 'image/webp') !== false) { |
| 196 | 196 | |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | |
| 347 | 347 | function spurs_register_cpts(){ |
| 348 | 348 | |
| 349 | - $cpts[] = array( |
|
| 349 | + $cpts[] = array( |
|
| 350 | 350 | 'name' => 'report', |
| 351 | 351 | 'names' => array( |
| 352 | 352 | 'singular' => 'report', |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | foreach ( $classes as $key => $value ) { |
| 51 | 51 | if ( 'tag' == $value ) { |
| 52 | - unset( $classes[ $key ] ); |
|
| 52 | + unset( $classes[$key] ); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
@@ -180,13 +180,13 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | if ( ! function_exists( 'bg' ) ) { |
| 182 | 182 | |
| 183 | - function bg($img, $size = '', $echo = true, $additional_style = '') { |
|
| 183 | + function bg( $img, $size = '', $echo = true, $additional_style = '' ) { |
|
| 184 | 184 | if ( ! $img ) { |
| 185 | 185 | $uploads = wp_get_upload_dir(); |
| 186 | 186 | $url = $uploads['baseurl'] . '/path_to_fallback_image.png'; // default placeholder image |
| 187 | 187 | } else { |
| 188 | 188 | if ( is_array( $img ) ) { |
| 189 | - $url = $size ? $img['sizes'][ $size ] : $img['url']; |
|
| 189 | + $url = $size ? $img['sizes'][$size] : $img['url']; |
|
| 190 | 190 | } else { |
| 191 | 191 | $url = $img; |
| 192 | 192 | } |
@@ -313,18 +313,18 @@ discard block |
||
| 313 | 313 | return $terms[0]; |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | -function spurs_get_excerpt_by_post($id, $length = 70) { |
|
| 316 | +function spurs_get_excerpt_by_post( $id, $length = 70 ) { |
|
| 317 | 317 | |
| 318 | - $content = get_the_content($id); |
|
| 318 | + $content = get_the_content( $id ); |
|
| 319 | 319 | |
| 320 | - if (null !== get_the_excerpt($id) && '' !== get_the_excerpt($id)) { |
|
| 321 | - $content = get_the_excerpt($id); |
|
| 320 | + if ( null !== get_the_excerpt( $id ) && '' !== get_the_excerpt( $id ) ) { |
|
| 321 | + $content = get_the_excerpt( $id ); |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | - $content = strip_tags($content, '<ul><li>'); |
|
| 325 | - $content = strip_shortcodes($content); |
|
| 326 | - if ( strlen($content) > $length ) { |
|
| 327 | - return substr($content, 0, $length) . '[..]'; |
|
| 324 | + $content = strip_tags( $content, '<ul><li>' ); |
|
| 325 | + $content = strip_shortcodes( $content ); |
|
| 326 | + if ( strlen( $content ) > $length ) { |
|
| 327 | + return substr( $content, 0, $length ) . '[..]'; |
|
| 328 | 328 | } else { |
| 329 | 329 | return $content; |
| 330 | 330 | } |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | spurs_register_taxonomies(); |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | -function spurs_register_cpts(){ |
|
| 347 | +function spurs_register_cpts() { |
|
| 348 | 348 | |
| 349 | 349 | $cpts[] = array( |
| 350 | 350 | 'name' => 'report', |
@@ -23,15 +23,15 @@ |
||
| 23 | 23 | <?php spurs_posted_on(); ?> |
| 24 | 24 | <div class="categories pb-3"> |
| 25 | 25 | <?php |
| 26 | - $category = spurs_get_primary_term( 'category' ); |
|
| 27 | - if ( $category instanceof WP_Term ) { |
|
| 28 | - printf( |
|
| 29 | - '<a href="%1$s"><span class="category">%2$s</span></a>', |
|
| 30 | - get_term_link($category), |
|
| 31 | - esc_html( $category->name ) |
|
| 32 | - ); |
|
| 33 | - } |
|
| 34 | - ?> |
|
| 26 | + $category = spurs_get_primary_term( 'category' ); |
|
| 27 | + if ( $category instanceof WP_Term ) { |
|
| 28 | + printf( |
|
| 29 | + '<a href="%1$s"><span class="category">%2$s</span></a>', |
|
| 30 | + get_term_link($category), |
|
| 31 | + esc_html( $category->name ) |
|
| 32 | + ); |
|
| 33 | + } |
|
| 34 | + ?> |
|
| 35 | 35 | </div> |
| 36 | 36 | </div> |
| 37 | 37 | <?php endif; ?> |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | global $post; |
| 12 | 12 | ?> |
| 13 | 13 | |
| 14 | -<article <?php post_class('card'); ?> id="post-<?php the_ID(); ?>"> |
|
| 14 | +<article <?php post_class( 'card' ); ?> id="post-<?php the_ID(); ?>"> |
|
| 15 | 15 | <div class="card-img-top img-wrapper"> |
| 16 | 16 | <a class="no-uppercase no-underline" href="<?php echo get_the_permalink(); ?>"> |
| 17 | 17 | <span class="bg-image" <?php bg( get_the_post_thumbnail_url(), false, true, 'height: 270px' ); ?>></span> |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | if ( $category instanceof WP_Term ) { |
| 28 | 28 | printf( |
| 29 | 29 | '<a href="%1$s"><span class="category">%2$s</span></a>', |
| 30 | - get_term_link($category), |
|
| 30 | + get_term_link( $category ), |
|
| 31 | 31 | esc_html( $category->name ) |
| 32 | 32 | ); |
| 33 | 33 | } |