@@ -13,14 +13,14 @@ discard block |
||
13 | 13 | <section id="primary" |
14 | 14 | <main id="content" role="main"> |
15 | 15 | |
16 | - <?php if ( have_posts() ) : ?> |
|
16 | + <?php if (have_posts()) : ?> |
|
17 | 17 | |
18 | 18 | <header class="page-header"> |
19 | 19 | <h1 class="page-title"> |
20 | 20 | <?php |
21 | 21 | printf( |
22 | - esc_html( 'STORIES %s', 'strip' ), '<span>' . |
|
23 | - single_cat_title( '', false ) . '</span>' |
|
22 | + esc_html('STORIES %s', 'strip'), '<span>' . |
|
23 | + single_cat_title('', false) . '</span>' |
|
24 | 24 | ); |
25 | 25 | ?> |
26 | 26 | </h1> |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | <?php |
29 | 29 | // Show an optional term description. |
30 | 30 | $term_description = term_description(); |
31 | - if ( ! empty( $term_description ) ) : |
|
32 | - '<div class="taxonomy-description"' . printf( esc_html( '%s', $term_description ) ) . '</div>'; |
|
31 | + if ( ! empty($term_description)) : |
|
32 | + '<div class="taxonomy-description"' . printf(esc_html('%s', $term_description)) . '</div>'; |
|
33 | 33 | endif; |
34 | 34 | ?> |
35 | 35 | </header><!-- .page-header --> |
@@ -47,24 +47,24 @@ discard block |
||
47 | 47 | ) |
48 | 48 | ); |
49 | 49 | |
50 | -while ( $comic->have_posts() ) : $comic->the_post(); |
|
51 | - get_template_part( 'content-comic' ); |
|
50 | +while ($comic->have_posts()) : $comic->the_post(); |
|
51 | + get_template_part('content-comic'); |
|
52 | 52 | // change to 'content' to style it like the blog entry page. |
53 | 53 | ?> |
54 | 54 | <?php endwhile; |
55 | 55 | wp_reset_postdata(); ?> |
56 | 56 | |
57 | 57 | <div class="wrap"> |
58 | - <?php the_posts_pagination( array( |
|
59 | - 'prev_text' => _x( '←', 'Previous page link', 'strip' ) . '<span class="screen-reader-text">' . __( 'Previous page', 'strip' ) . '</span>', |
|
60 | - 'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'strip' ) . '</span>' . _x( '→', 'Next post link', 'strip' ), |
|
61 | - 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'strip' ) . ' </span>', |
|
62 | - ) ); ?> |
|
58 | + <?php the_posts_pagination(array( |
|
59 | + 'prev_text' => _x('←', 'Previous page link', 'strip') . '<span class="screen-reader-text">' . __('Previous page', 'strip') . '</span>', |
|
60 | + 'next_text' => '<span class="screen-reader-text">' . __('Next page', 'strip') . '</span>' . _x('→', 'Next post link', 'strip'), |
|
61 | + 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __('Page', 'strip') . ' </span>', |
|
62 | + )); ?> |
|
63 | 63 | </div> |
64 | 64 | |
65 | 65 | <?php else : ?> |
66 | 66 | |
67 | - <?php get_template_part( 'no-results', 'archive-comic' ); ?> |
|
67 | + <?php get_template_part('no-results', 'archive-comic'); ?> |
|
68 | 68 | |
69 | 69 | <?php endif; |
70 | 70 | wp_reset_postdata(); ?> |
@@ -62,9 +62,12 @@ |
||
62 | 62 | ) ); ?> |
63 | 63 | </div> |
64 | 64 | |
65 | - <?php else : ?> |
|
65 | + <?php else { |
|
66 | + : ?> |
|
66 | 67 | |
67 | - <?php get_template_part( 'no-results', 'archive-comic' ); ?> |
|
68 | + <?php get_template_part( 'no-results', 'archive-comic' ); |
|
69 | +} |
|
70 | +?> |
|
68 | 71 | |
69 | 72 | <?php endif; |
70 | 73 | wp_reset_postdata(); ?> |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | |
15 | 15 | <header class="page-header"> |
16 | 16 | |
17 | - <h1 class="page-title"><?php single_term_title( 'All episodes: ' ); ?></h1> |
|
17 | + <h1 class="page-title"><?php single_term_title('All episodes: '); ?></h1> |
|
18 | 18 | |
19 | 19 | <?php |
20 | 20 | // Show an optional term description. |
21 | 21 | $term_description = term_description(); |
22 | - if ( ! empty( $term_description ) ) : |
|
23 | - printf( '<div class="taxonomy-description">%s</div>', $term_description, 'strip' ); // WPCS: XSS OK. |
|
22 | + if ( ! empty($term_description)) : |
|
23 | + printf('<div class="taxonomy-description">%s</div>', $term_description, 'strip'); // WPCS: XSS OK. |
|
24 | 24 | endif; |
25 | 25 | ?> |
26 | 26 | |
@@ -36,30 +36,30 @@ discard block |
||
36 | 36 | 'order' => 'ASC', |
37 | 37 | ); |
38 | 38 | |
39 | - $loop = new WP_Query( $args ); |
|
39 | + $loop = new WP_Query($args); |
|
40 | 40 | // Start the loop. |
41 | - if ( $loop->have_posts() ) : |
|
41 | + if ($loop->have_posts()) : |
|
42 | 42 | $i = 1; |
43 | - while ( $loop->have_posts() && $i < 3 ) : $loop->the_post(); // 3 sets the posts per page. @link https://digwp.com/2009/12/limit-posts-without-plugin/ |
|
43 | + while ($loop->have_posts() && $i < 3) : $loop->the_post(); // 3 sets the posts per page. @link https://digwp.com/2009/12/limit-posts-without-plugin/ |
|
44 | 44 | |
45 | - get_template_part( 'content-series' ); ?> |
|
45 | + get_template_part('content-series'); ?> |
|
46 | 46 | |
47 | 47 | <?php $i++; |
48 | 48 | endwhile; |
49 | 49 | wp_reset_postdata(); ?> |
50 | 50 | |
51 | 51 | <div class="wrap"> |
52 | - <?php the_posts_pagination( array( |
|
53 | - 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'strip' ) . ' </span>', |
|
54 | - 'prev_text' => __( 'Previous', 'strip' ), // In case you want to change the previous link text. |
|
55 | - 'next_text' => __( 'Next', 'strip' ), // In case you want to change the next link text. |
|
52 | + <?php the_posts_pagination(array( |
|
53 | + 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __('Page', 'strip') . ' </span>', |
|
54 | + 'prev_text' => __('Previous', 'strip'), // In case you want to change the previous link text. |
|
55 | + 'next_text' => __('Next', 'strip'), // In case you want to change the next link text. |
|
56 | 56 | 'type' => 'title', // How you want the return value to be formatted. |
57 | 57 | 'add_fragment' => '#result', // Your anchor. |
58 | - ) ); ?> |
|
58 | + )); ?> |
|
59 | 59 | </div> |
60 | 60 | |
61 | 61 | <?php else : |
62 | - get_template_part( 'no-results', 'archive-comic' ); |
|
62 | + get_template_part('no-results', 'archive-comic'); |
|
63 | 63 | endif; ?> |
64 | 64 | |
65 | 65 | </main><!-- #content --> |
@@ -58,8 +58,10 @@ |
||
58 | 58 | ) ); ?> |
59 | 59 | </div> |
60 | 60 | |
61 | -<?php else : |
|
61 | +<?php else { |
|
62 | + : |
|
62 | 63 | get_template_part( 'no-results', 'archive-comic' ); |
64 | +} |
|
63 | 65 | endif; ?> |
64 | 66 | |
65 | 67 | </main><!-- #content --> |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | * @subpackage Strip |
7 | 7 | */ |
8 | 8 | |
9 | -if ( post_type_exists( $post_type ) && is_single() ) { |
|
10 | - get_header( 'lite' ); |
|
9 | +if (post_type_exists($post_type) && is_single()) { |
|
10 | + get_header('lite'); |
|
11 | 11 | } else { |
12 | 12 | get_header(); |
13 | 13 | } |
@@ -18,25 +18,25 @@ discard block |
||
18 | 18 | |
19 | 19 | <?php |
20 | 20 | // Start the loop. |
21 | - while ( have_posts() ) : the_post(); ?> |
|
21 | + while (have_posts()) : the_post(); ?> |
|
22 | 22 | |
23 | 23 | <div class="entry-comic"> |
24 | 24 | |
25 | - <?php get_template_part( 'content-comic' ); ?> |
|
25 | + <?php get_template_part('content-comic'); ?> |
|
26 | 26 | |
27 | 27 | <div class="wrap clear"> |
28 | 28 | |
29 | - <h1 class="screen-reader-text"><?php esc_html_e( 'Post navigation', 'strip' ); ?></h1> |
|
29 | + <h1 class="screen-reader-text"><?php esc_html_e('Post navigation', 'strip'); ?></h1> |
|
30 | 30 | |
31 | 31 | <div class="navigation-comic"> |
32 | - <nav class="nav-first"><a href="<?php echo esc_url( first_comic_link() ); ?>"><?php esc_html_e( 'Start', 'strip' ); ?></a></nav> |
|
33 | - <nav class="nav-previous"><?php previous_post_link( '%link', __( 'Previous', 'strip' ), true, '', 'story' ); ?></nav> |
|
34 | - <nav class="nav-title"><?php the_title( '<h4 class="series-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h4>' ); ?></nav> |
|
35 | - <nav class="nav-next"><?php next_post_link( '%link', __( 'Next', 'strip' ), true, '', 'story' ); ?></nav> |
|
36 | - <nav class="nav-last"><a href="<?php echo esc_url( last_comic_link() ); ?>"><?php esc_html_e( 'Last', 'strip' ); ?></a></nav> |
|
32 | + <nav class="nav-first"><a href="<?php echo esc_url(first_comic_link()); ?>"><?php esc_html_e('Start', 'strip'); ?></a></nav> |
|
33 | + <nav class="nav-previous"><?php previous_post_link('%link', __('Previous', 'strip'), true, '', 'story'); ?></nav> |
|
34 | + <nav class="nav-title"><?php the_title('<h4 class="series-title"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h4>'); ?></nav> |
|
35 | + <nav class="nav-next"><?php next_post_link('%link', __('Next', 'strip'), true, '', 'story'); ?></nav> |
|
36 | + <nav class="nav-last"><a href="<?php echo esc_url(last_comic_link()); ?>"><?php esc_html_e('Last', 'strip'); ?></a></nav> |
|
37 | 37 | </div><!-- .wrap --> |
38 | 38 | |
39 | - <?php set_transient( 'story', $post_type );?> |
|
39 | + <?php set_transient('story', $post_type); ?> |
|
40 | 40 | |
41 | 41 | </div><!-- #entry-comic --> |
42 | 42 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | <?php |
46 | 46 | // If comments are open or we have at least one comment, load up the comment template. |
47 | - if ( comments_open() || '0' !== get_comments_number() ) : |
|
47 | + if (comments_open() || '0' !== get_comments_number()) : |
|
48 | 48 | comments_template(); |
49 | 49 | endif; |
50 | 50 | |
@@ -52,4 +52,4 @@ discard block |
||
52 | 52 | |
53 | 53 | </main><!-- #content --> |
54 | 54 | </section><!-- #primary --> |
55 | -<?php get_footer( 'lite' ); ?> |
|
55 | +<?php get_footer('lite'); ?> |
@@ -6,14 +6,14 @@ discard block |
||
6 | 6 | * @subpackage Strip |
7 | 7 | */ |
8 | 8 | |
9 | -get_header( 'lite' ); |
|
9 | +get_header('lite'); |
|
10 | 10 | ?> |
11 | 11 | <div id="primary" class="content-area image-attachment"> |
12 | 12 | <div id="content" class="site-content" role="main"> |
13 | 13 | |
14 | 14 | <?php |
15 | 15 | // Start the loop. |
16 | - while ( have_posts() ) : |
|
16 | + while (have_posts()) : |
|
17 | 17 | the_post(); ?> |
18 | 18 | |
19 | 19 | <article id="post-<?php the_ID(); ?>"> |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @param string $image_size Image size. Default 'full'. |
31 | 31 | */ |
32 | - $image_size = apply_filters( 'strip_attachment_size', 'full' ); |
|
32 | + $image_size = apply_filters('strip_attachment_size', 'full'); |
|
33 | 33 | |
34 | - echo wp_get_attachment_image( get_the_ID(), $image_size ); |
|
34 | + echo wp_get_attachment_image(get_the_ID(), $image_size); |
|
35 | 35 | |
36 | 36 | ?> |
37 | 37 | |
@@ -40,18 +40,18 @@ discard block |
||
40 | 40 | <?php // image navigation. ?> |
41 | 41 | <nav role="navigation" id="image-navigation" class="image-navigation"> |
42 | 42 | |
43 | - <div class="previous"><?php previous_image_link( false, __( '<span class="meta-nav">←</span> <span class="text-nav">Previous panel</span>', 'strip' ) ); ?></div> |
|
44 | - <div class="next"><?php next_image_link( false, __( '<span class="meta-nav">→</span> <span class="text-nav">Next panel</span>', 'strip' ) ); ?></div> |
|
43 | + <div class="previous"><?php previous_image_link(false, __('<span class="meta-nav">←</span> <span class="text-nav">Previous panel</span>', 'strip')); ?></div> |
|
44 | + <div class="next"><?php next_image_link(false, __('<span class="meta-nav">→</span> <span class="text-nav">Next panel</span>', 'strip')); ?></div> |
|
45 | 45 | |
46 | 46 | <nav class="post-parent-title"> |
47 | - <?php printf( '<a href="%s" class="post-parent-title">%s</a>', |
|
48 | - esc_url( get_permalink( $post->post_parent ) ), |
|
49 | - esc_html( get_the_title( $post->post_parent ) ) |
|
47 | + <?php printf('<a href="%s" class="post-parent-title">%s</a>', |
|
48 | + esc_url(get_permalink($post->post_parent)), |
|
49 | + esc_html(get_the_title($post->post_parent)) |
|
50 | 50 | ); ?> |
51 | 51 | </nav> |
52 | 52 | </nav><!-- #image-navigation --> |
53 | 53 | |
54 | - <?php if ( has_excerpt() ) : ?> |
|
54 | + <?php if (has_excerpt()) : ?> |
|
55 | 55 | <div class="entry-caption"> |
56 | 56 | <?php the_excerpt(); ?> |
57 | 57 | </div><!-- .entry-caption --> |
@@ -66,4 +66,4 @@ discard block |
||
66 | 66 | </div><!-- #content --> |
67 | 67 | </div><!-- #primary --> |
68 | 68 | |
69 | -<?php get_footer( 'lite' ); ?> |
|
69 | +<?php get_footer('lite'); ?> |
@@ -12,47 +12,47 @@ discard block |
||
12 | 12 | * Add custom header image to header area |
13 | 13 | */ |
14 | 14 | function strip_header_background() { |
15 | - if ( get_header_image() ) { |
|
16 | - $css = '.site-branding { background-image: url(' . esc_url( get_header_image() ) . '); }'; |
|
17 | - wp_add_inline_style( 'strip-style', $css ); |
|
15 | + if (get_header_image()) { |
|
16 | + $css = '.site-branding { background-image: url(' . esc_url(get_header_image()) . '); }'; |
|
17 | + wp_add_inline_style('strip-style', $css); |
|
18 | 18 | } |
19 | 19 | } |
20 | -add_action( 'wp_enqueue_scripts', 'strip_header_background', 11 ); |
|
20 | +add_action('wp_enqueue_scripts', 'strip_header_background', 11); |
|
21 | 21 | |
22 | -if ( ! function_exists( 'strip_entry_meta' ) ) : |
|
22 | +if ( ! function_exists('strip_entry_meta')) : |
|
23 | 23 | /** |
24 | 24 | * Prints HTML with meta information for the current post-date/time and author. |
25 | 25 | */ |
26 | 26 | function strip_entry_meta() { |
27 | - if ( is_sticky() && is_home() ) { |
|
27 | + if (is_sticky() && is_home()) { |
|
28 | 28 | printf( |
29 | - wp_kses( '<span class="featured-post"><a href="%1$s" title="%2$s" rel="bookmark">Sticky</a></span>', 'strip' ), |
|
30 | - esc_url( get_permalink() ), |
|
31 | - esc_attr( get_the_time() ) |
|
29 | + wp_kses('<span class="featured-post"><a href="%1$s" title="%2$s" rel="bookmark">Sticky</a></span>', 'strip'), |
|
30 | + esc_url(get_permalink()), |
|
31 | + esc_attr(get_the_time()) |
|
32 | 32 | ); |
33 | 33 | } |
34 | 34 | |
35 | - if ( 'post' === get_post_type() ) { |
|
35 | + if ('post' === get_post_type()) { |
|
36 | 36 | printf( |
37 | - wp_kses_post( '<span class="entry-date"><a href="%1$s" title="%2$s" rel="bookmark"><time datetime="%3$s">%4$s</time></a></span><span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span>', 'strip' ), |
|
38 | - esc_url( get_permalink() ), |
|
39 | - esc_attr( get_the_time() ), |
|
40 | - esc_attr( get_the_date( 'c' ) ), |
|
37 | + wp_kses_post('<span class="entry-date"><a href="%1$s" title="%2$s" rel="bookmark"><time datetime="%3$s">%4$s</time></a></span><span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span>', 'strip'), |
|
38 | + esc_url(get_permalink()), |
|
39 | + esc_attr(get_the_time()), |
|
40 | + esc_attr(get_the_date('c')), |
|
41 | 41 | get_the_date(), |
42 | - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), |
|
43 | - esc_attr( sprintf( __( 'View all posts by %s', 'strip' ), get_the_author() ) ), |
|
42 | + esc_url(get_author_posts_url(get_the_author_meta('ID'))), |
|
43 | + esc_attr(sprintf(__('View all posts by %s', 'strip'), get_the_author())), |
|
44 | 44 | get_the_author() |
45 | 45 | ); |
46 | 46 | } |
47 | 47 | |
48 | - $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'strip' ) ); |
|
49 | - if ( $tags_list ) { |
|
50 | - printf( '<span class="tags-links">' . esc_html( '%1$s', 'strip' ) . '</span>', $tags_list ); // WPCS: XSS OK. |
|
48 | + $tags_list = get_the_tag_list('', _x(', ', 'Used between list items, there is a space after the comma.', 'strip')); |
|
49 | + if ($tags_list) { |
|
50 | + printf('<span class="tags-links">' . esc_html('%1$s', 'strip') . '</span>', $tags_list); // WPCS: XSS OK. |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | endif; |
54 | 54 | |
55 | -if ( ! function_exists( 'strip_term_description' ) ) : |
|
55 | +if ( ! function_exists('strip_term_description')) : |
|
56 | 56 | /** |
57 | 57 | * Display optional term description for category, tag and custom taxonomy pages. |
58 | 58 | * |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | // Show an optional term description. |
63 | 63 | $term_description = term_description(); |
64 | 64 | |
65 | - if ( is_post_type_archive( 'comic' ) || is_category() || is_tag() || is_tax( 'story' ) && ! empty( $term_description ) ) : |
|
66 | - printf( '<div class="taxonomy-description">%s</div>', $term_description, 'strip' ); // WPCS: XSS OK. |
|
65 | + if (is_post_type_archive('comic') || is_category() || is_tag() || is_tax('story') && ! empty($term_description)) : |
|
66 | + printf('<div class="taxonomy-description">%s</div>', $term_description, 'strip'); // WPCS: XSS OK. |
|
67 | 67 | endif; |
68 | 68 | } |
69 | 69 | endif; // ends check for strip_term_description. |
@@ -74,25 +74,25 @@ discard block |
||
74 | 74 | * @return bool |
75 | 75 | */ |
76 | 76 | function strip_categorized_blog() { |
77 | - $category_count = get_transient( 'strip_categories' ); |
|
77 | + $category_count = get_transient('strip_categories'); |
|
78 | 78 | |
79 | - if ( false === $category_count ) { |
|
79 | + if (false === $category_count) { |
|
80 | 80 | // Create an array of all the categories that are attached to posts. |
81 | - $categories = get_categories( array( |
|
81 | + $categories = get_categories(array( |
|
82 | 82 | 'fields' => 'ids', |
83 | 83 | 'hide_empty' => 1, |
84 | 84 | // We only need to know if there is more than one category. |
85 | 85 | 'number' => 2, |
86 | - ) ); |
|
86 | + )); |
|
87 | 87 | |
88 | 88 | // Count the number of categories that are attached to the posts. |
89 | - $category_count = count( $categories ); |
|
89 | + $category_count = count($categories); |
|
90 | 90 | |
91 | - set_transient( 'strip_categories', $category_count ); |
|
91 | + set_transient('strip_categories', $category_count); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | // Allow viewing case of 0 or 1 categories in post preview. |
95 | - if ( is_preview() ) { |
|
95 | + if (is_preview()) { |
|
96 | 96 | return true; |
97 | 97 | } |
98 | 98 | |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | * Flush out the transients used in strip_categorized_blog. |
105 | 105 | */ |
106 | 106 | function strip_category_transient_flusher() { |
107 | - if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { |
|
107 | + if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { |
|
108 | 108 | return; |
109 | 109 | } |
110 | 110 | // Like, beat it. Dig? |
111 | - delete_transient( 'strip_categories' ); |
|
111 | + delete_transient('strip_categories'); |
|
112 | 112 | } |
113 | -add_action( 'edit_category', 'strip_category_transient_flusher' ); |
|
114 | -add_action( 'save_post', 'strip_category_transient_flusher' ); |
|
113 | +add_action('edit_category', 'strip_category_transient_flusher'); |
|
114 | +add_action('save_post', 'strip_category_transient_flusher'); |
|
115 | 115 | |
116 | -if ( ! function_exists( 'strip_the_custom_logo' ) ) : |
|
116 | +if ( ! function_exists('strip_the_custom_logo')) : |
|
117 | 117 | /** |
118 | 118 | * Displays the optional custom logo. |
119 | 119 | * |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @since strip 1.0 |
123 | 123 | */ |
124 | 124 | function strip_the_custom_logo() { |
125 | - if ( function_exists( 'the_custom_logo' ) ) { |
|
125 | + if (function_exists('the_custom_logo')) { |
|
126 | 126 | the_custom_logo(); |
127 | 127 | } |
128 | 128 | } |
@@ -138,10 +138,10 @@ discard block |
||
138 | 138 | * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. |
139 | 139 | * @return mixed Array containing the boundary post object if successful, null otherwise. |
140 | 140 | */ |
141 | -function get_comic_boundary_post( $in_same_term, $start, $taxonomy ) { |
|
141 | +function get_comic_boundary_post($in_same_term, $start, $taxonomy) { |
|
142 | 142 | global $post; |
143 | - setup_postdata( $post ); |
|
144 | - if ( ! taxonomy_exists( $taxonomy ) ) { |
|
143 | + setup_postdata($post); |
|
144 | + if ( ! taxonomy_exists($taxonomy)) { |
|
145 | 145 | return null; |
146 | 146 | } |
147 | 147 | |
@@ -155,37 +155,37 @@ discard block |
||
155 | 155 | ); |
156 | 156 | |
157 | 157 | $term_array = array(); |
158 | - if ( $in_same_term ) { |
|
159 | - if ( $in_same_term ) { |
|
160 | - $term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) ); |
|
158 | + if ($in_same_term) { |
|
159 | + if ($in_same_term) { |
|
160 | + $term_array = wp_get_object_terms($post->ID, $taxonomy, array('fields' => 'ids')); |
|
161 | 161 | } |
162 | - $query_args['tax_query'] = array( array( |
|
162 | + $query_args['tax_query'] = array(array( |
|
163 | 163 | 'taxonomy' => $taxonomy, |
164 | - 'terms' => array_merge( $term_array ), |
|
164 | + 'terms' => array_merge($term_array), |
|
165 | 165 | ), |
166 | 166 | ); |
167 | 167 | } |
168 | 168 | |
169 | 169 | $get_posts = new wp_query; |
170 | - return $get_posts -> query( $query_args ); |
|
170 | + return $get_posts -> query($query_args); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
174 | 174 | * Link to the first comic post in same term |
175 | 175 | */ |
176 | 176 | function first_comic_link() { |
177 | - $first = get_comic_boundary_post( true, true, 'story' ); |
|
178 | - apply_filters( 'the_title', $first[0]->post_title ); |
|
177 | + $first = get_comic_boundary_post(true, true, 'story'); |
|
178 | + apply_filters('the_title', $first[0]->post_title); |
|
179 | 179 | |
180 | - echo esc_html( get_permalink( $first[0]->ID ) ); |
|
180 | + echo esc_html(get_permalink($first[0]->ID)); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
184 | 184 | * Link to the last comic post in same term |
185 | 185 | */ |
186 | 186 | function last_comic_link() { |
187 | - $last = get_comic_boundary_post( true, false, 'story' ); |
|
188 | - apply_filters( 'the_title', $last[0]->post_title ); |
|
187 | + $last = get_comic_boundary_post(true, false, 'story'); |
|
188 | + apply_filters('the_title', $last[0]->post_title); |
|
189 | 189 | |
190 | - echo esc_html( get_permalink( $last[0]->ID ) ); |
|
190 | + echo esc_html(get_permalink($last[0]->ID)); |
|
191 | 191 | } |
@@ -13,14 +13,14 @@ |
||
13 | 13 | <footer id="colophon" class="site-footer" role="contentinfo"> |
14 | 14 | |
15 | 15 | <div class="site-info"> |
16 | - © <span class="site-name"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span> <?php |
|
16 | + © <span class="site-name"><a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></span> <?php |
|
17 | 17 | $from_year = 2016; |
18 | - $this_year = (int) date( 'Y' ); |
|
19 | - echo esc_html( $from_year . (($from_year !== $this_year) ? '-' . $this_year : '') );?> |
|
18 | + $this_year = (int) date('Y'); |
|
19 | + echo esc_html($from_year . (($from_year !== $this_year) ? '-' . $this_year : '')); ?> |
|
20 | 20 | <span class="sep"> | </span> |
21 | - <?php do_action( 'strip_credits' ); |
|
21 | + <?php do_action('strip_credits'); |
|
22 | 22 | ?> |
23 | - <a href="<?php echo esc_url( __( 'https://github.com/SilentComics/Strip', 'strip' ) ); ?>"><?php printf( esc_html__( 'Theme: %1$s by %2$s.', 'strip' ), 'strip', 'Hoa' ); ?></a> |
|
23 | + <a href="<?php echo esc_url(__('https://github.com/SilentComics/Strip', 'strip')); ?>"><?php printf(esc_html__('Theme: %1$s by %2$s.', 'strip'), 'strip', 'Hoa'); ?></a> |
|
24 | 24 | </div><!-- .site-info --> |
25 | 25 | </footer><!-- #colophon --> |
26 | 26 | </div><!-- #page --> |
@@ -99,8 +99,10 @@ |
||
99 | 99 | 'add_fragment' => '#result', // Your anchor. |
100 | 100 | ) ) ); |
101 | 101 | |
102 | - else : |
|
102 | + else { |
|
103 | + : |
|
103 | 104 | get_template_part( 'no-results', 'archive-comic' ); |
105 | + } |
|
104 | 106 | endif; ?> |
105 | 107 | |
106 | 108 | </div><!-- .wrap --> |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | <div class="wrap"> |
18 | 18 | <header class="entry-header"> |
19 | 19 | <h3 class="taxonomy-description"> |
20 | - <?php printf( '<a href="%s" class="post-parent-title">%s</a>', |
|
21 | - esc_url( get_post_type_archive_link( 'comic' ) ), |
|
22 | - esc_html( get_the_title() ) |
|
20 | + <?php printf('<a href="%s" class="post-parent-title">%s</a>', |
|
21 | + esc_url(get_post_type_archive_link('comic')), |
|
22 | + esc_html(get_the_title()) |
|
23 | 23 | ); ?> |
24 | 24 | </a></h3> |
25 | 25 | <h1 class="page-title"><?php the_title(); ?></h1> |
@@ -29,34 +29,34 @@ discard block |
||
29 | 29 | |
30 | 30 | <?php |
31 | 31 | // get the correct paged figure on a Custom Page That Isn’t Static Home Page. |
32 | - $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; ?> |
|
32 | + $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?> |
|
33 | 33 | |
34 | 34 | |
35 | 35 | <?php |
36 | 36 | |
37 | 37 | // Call and run loop in descending order. |
38 | - $loop = new WP_Query( array( |
|
38 | + $loop = new WP_Query(array( |
|
39 | 39 | 'post_type' => 'comic', |
40 | 40 | 'story' => '', // add story term here if you want this template to only archive a specific story. |
41 | 41 | 'posts_per_page' => 12, // changes default Blog pages number "reading settings" set in dashboard. |
42 | 42 | 'paged' => $paged, // you absolutely need this. |
43 | 43 | 'orderby' => 'title', // order by title or date. |
44 | 44 | 'order' => 'DESC', |
45 | - ) ); |
|
45 | + )); |
|
46 | 46 | |
47 | 47 | // Start the loop. |
48 | - if ( $loop->have_posts() ) : |
|
49 | - while ( $loop->have_posts() ) : |
|
48 | + if ($loop->have_posts()) : |
|
49 | + while ($loop->have_posts()) : |
|
50 | 50 | $loop->the_post(); |
51 | 51 | ?> |
52 | 52 | <div class="three-column"> |
53 | - <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf( esc_html__( 'Permanent Link to %s', 'strip' ),the_title_attribute( 'echo=0' ) ); ?>"></a> |
|
54 | - <?php if ( get_the_post_thumbnail() !== '' ) { |
|
53 | + <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf(esc_html__('Permanent Link to %s', 'strip'), the_title_attribute('echo=0')); ?>"></a> |
|
54 | + <?php if (get_the_post_thumbnail() !== '') { |
|
55 | 55 | |
56 | 56 | echo '<a href="'; |
57 | 57 | the_permalink(); |
58 | 58 | echo '" class="thumbnail-wrapper">'; |
59 | - the_post_thumbnail( 'thumbnail' ); |
|
59 | + the_post_thumbnail('thumbnail'); |
|
60 | 60 | |
61 | 61 | echo '</a>'; |
62 | 62 | |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | the_permalink(); |
67 | 67 | echo '" class="thumbnail-wrapper">'; |
68 | 68 | echo '<img src="'; |
69 | - echo esc_html( get_first_image() ); |
|
69 | + echo esc_html(get_first_image()); |
|
70 | 70 | echo '" alt="" />'; |
71 | 71 | echo '</a>'; |
72 | 72 | } ?> |
73 | 73 | |
74 | -<h2 class="series-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf( esc_html__( 'Permanent Link to %s', 'strip' ), the_title_attribute( 'echo=0' ) ); ?>"><?php the_title(); ?></a></h2> |
|
74 | +<h2 class="series-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf(esc_html__('Permanent Link to %s', 'strip'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></h2> |
|
75 | 75 | |
76 | 76 | </div><!-- .column --> |
77 | 77 | <?php endwhile; ?> |
@@ -82,23 +82,23 @@ discard block |
||
82 | 82 | |
83 | 83 | <?php |
84 | 84 | $big = 999999999; // need an unlikely integer. |
85 | - $translated = __( 'Page', 'strip' ); // supply translatable string. |
|
85 | + $translated = __('Page', 'strip'); // supply translatable string. |
|
86 | 86 | |
87 | - echo wp_kses_post( paginate_links( // Data validation: wp_kses_post see https://developer.wordpress.org/reference/functions/wp_kses_post/. |
|
87 | + echo wp_kses_post(paginate_links( // Data validation: wp_kses_post see https://developer.wordpress.org/reference/functions/wp_kses_post/. |
|
88 | 88 | array( |
89 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
89 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
90 | 90 | 'format' => '?paged=%#%', |
91 | - 'current' => max( 1, get_query_var( 'paged', 1 ) ), |
|
91 | + 'current' => max(1, get_query_var('paged', 1)), |
|
92 | 92 | 'total' => $loop->max_num_pages, |
93 | 93 | 'before_page_number' => '<span class="screen-reader-text">' . $translated . ' </span>', |
94 | - 'prev_text' => esc_html__( 'Previous', 'strip' ), // If you want to change the previous link text. |
|
95 | - 'next_text' => esc_html__( 'Next', 'strip' ), // If you want to change the next link text. |
|
94 | + 'prev_text' => esc_html__('Previous', 'strip'), // If you want to change the previous link text. |
|
95 | + 'next_text' => esc_html__('Next', 'strip'), // If you want to change the next link text. |
|
96 | 96 | 'type' => 'title', // How you want the return value to be formatted. |
97 | 97 | 'add_fragment' => '#result', // Your anchor. |
98 | - ) ) ); |
|
98 | + ) )); |
|
99 | 99 | |
100 | 100 | else : |
101 | - get_template_part( 'no-results', 'archive-comic' ); |
|
101 | + get_template_part('no-results', 'archive-comic'); |
|
102 | 102 | endif; ?> |
103 | 103 | |
104 | 104 | </div><!-- .wrap --> |
@@ -13,20 +13,20 @@ |
||
13 | 13 | <section id="primary"> |
14 | 14 | <main id="content" role="main"> |
15 | 15 | |
16 | - <?php while ( have_posts() ) : the_post(); ?> |
|
16 | + <?php while (have_posts()) : the_post(); ?> |
|
17 | 17 | |
18 | - <?php get_template_part( 'content', get_post_format() ); ?> |
|
18 | + <?php get_template_part('content', get_post_format()); ?> |
|
19 | 19 | |
20 | 20 | <?php |
21 | 21 | // If comments are open or we have at least one comment, load up the comment template. |
22 | - if ( comments_open() || '0' !== get_comments_number() ) : |
|
22 | + if (comments_open() || '0' !== get_comments_number()) : |
|
23 | 23 | comments_template(); |
24 | 24 | endif; |
25 | 25 | |
26 | - the_post_navigation( array( |
|
27 | - 'prev_text' => '<span class="screen-reader-text">' . __( 'Previous Post', 'strip' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . esc_html_x( '←', 'Previous post link', 'strip' ) . '</span> %title</span>', |
|
28 | - 'next_text' => '<span class="screen-reader-text">' . __( 'Next Post', 'strip' ) . '</span> %title <span aria-hidden="true" class="nav-subtitle">' . esc_html_x( '→', 'Next post link', 'strip' ) . '</span> </span>', |
|
29 | - ) ); |
|
26 | + the_post_navigation(array( |
|
27 | + 'prev_text' => '<span class="screen-reader-text">' . __('Previous Post', 'strip') . '</span><span aria-hidden="true" class="nav-subtitle">' . esc_html_x('←', 'Previous post link', 'strip') . '</span> %title</span>', |
|
28 | + 'next_text' => '<span class="screen-reader-text">' . __('Next Post', 'strip') . '</span> %title <span aria-hidden="true" class="nav-subtitle">' . esc_html_x('→', 'Next post link', 'strip') . '</span> </span>', |
|
29 | + )); |
|
30 | 30 | |
31 | 31 | endwhile; // end of the loop. ?> |
32 | 32 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | 'posts_per_page' => false, |
24 | 24 | )); |
25 | 25 | } |
26 | -add_action( 'after_setup_theme', 'strip_infinite_scroll_setup' ); |
|
26 | +add_action('after_setup_theme', 'strip_infinite_scroll_setup'); |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Enables Jetpack's Infinite Scroll for home (blog) |
@@ -32,6 +32,6 @@ discard block |
||
32 | 32 | * https://wordpress.org/support/topic/suppress-infinite-blog-with-woocommerce |
33 | 33 | */ |
34 | 34 | function strip_jetpack_infinite_scroll_supported() { |
35 | - return current_theme_supports( 'infinite-scroll' ) && ( is_admin() || is_home() || is_search() ); |
|
35 | + return current_theme_supports('infinite-scroll') && (is_admin() || is_home() || is_search()); |
|
36 | 36 | } |
37 | -add_filter( 'infinite_scroll_archive_supported', 'strip_jetpack_infinite_scroll_supported' ); |
|
37 | +add_filter('infinite_scroll_archive_supported', 'strip_jetpack_infinite_scroll_supported'); |