Passed
Branch master (712bec)
by SILENT
02:29
created

archive.php (4 issues)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * The template for displaying Archive pages
4
 *
5
 * @link https://codex.wordpress.org/Template_Hierarchy
6
 *
7
 * @package WordPress
8
 * @subpackage Strip
9
 */
10
11
get_header(); ?>
12
13
	<div id="primary"
14
		<div id="content" role="main">
15
16
	<?php if ( have_posts() ) : ?>
17
18
		<header class="page-header">
19
			<div class="wrap">
20
				<h1 class="page-title">
21
					<?php
22
					if ( is_author() && get_the_author_meta( 'description' ) ) {
23
						echo '<div class="author-index shorter">';
24
						get_template_part( 'inc/author','box' );
25
						echo '</div>';
26
					}
27
					?>
28
						<?php
29
						if ( is_category() ) :
30
							printf( esc_html__( 'Category Archives: %s', 'strip' ), '<span>' . single_cat_title( '', false ) . '</span>' );
31
32
							elseif ( is_tag() ) :
33
								printf( esc_html__( 'Tag Archives: %s', 'strip' ), '<span>' . single_tag_title( '', false ) . '</span>' );
34
35
							elseif ( is_author() ) :
36
								printf( esc_html__( 'All articles by %s', 'strip' ), '<span class="vcard">' . get_the_author() . '</span>' );
37
38
							elseif ( is_day() ) :
39
								printf( esc_html__( 'Daily Archives: %s', 'strip' ), '<span>' . get_the_date() . '</span>' );
40
41
							elseif ( is_month() ) :
42
								printf( esc_html__( 'Monthly Archives: %s', 'strip' ), '<span>' . get_the_date( 'F Y' ) . '</span>' );
43
44
							elseif ( is_year() ) :
45
								printf( esc_html__( 'Yearly Archives: %s', 'strip' ), '<span>' . get_the_date( 'Y' ) . '</span>' );
46
47
							elseif ( is_tax( 'post_format', 'post-format-aside' ) ) :
48
								esc_html_e( 'Asides', 'strip' );
49
50
								elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) :
51
									esc_html_e( 'Galleries', 'strip' );
52
53
							elseif ( is_tax( 'post_format', 'post-format-image' ) ) :
54
								esc_html_e( 'Images', 'strip' );
55
56
							elseif ( is_tax( 'post_format', 'post-format-video' ) ) :
57
								esc_html_e( 'Videos', 'strip' );
58
59
							elseif ( is_tax( 'post_format', 'post-format-quote' ) ) :
60
								esc_html_e( 'Quotes', 'strip' );
61
62
							elseif ( is_tax( 'post_format', 'post-format-link' ) ) :
63
								esc_html_e( 'Links', 'strip' );
64
65
								elseif ( is_tax( 'post_format', 'post-format-audio' ) ) :
66
									esc_html_e( 'Audios', 'strip' );
67
68
							elseif ( is_tax( 'post_format', 'post-format-chat' ) ) :
69
								esc_html_e( 'Chats', 'strip' );
70
71
							elseif ( is_tax( 'story', 'story_term' ) ) :
72
								esc_html_e( 'Stories', 'strip' );
73
								get_template_part( 'archive-comic' );
74
75
						elseif ( ! 'comic' === get_post_type() ) :
76
							esc_html_e( 'Comics', 'strip' );
77
78
							else :
79
								esc_html_e( 'Archives', 'strip' );
80
81
							endif;
82
						?>
83
					</h1>
84
					<?php
85
						// Show an optional term description.
86
						$term_description = term_description();
87
					if ( ! empty( $term_description ) ) :
88
						echo '<div class="taxonomy-description">';
89
						echo term_description();
90
						echo '</div>';
91
			endif;
92
					?>
93
				</div><!-- .wrap -->
94
			</header><!-- .page-header -->
95
96
			<?php /* Start the Loop */ ?>
97
			<?php while ( have_posts() ) : the_post(); ?>
98
99
				<?php
100
101
					/*
102
					 Include the Post-Format-specific template for the content.
103
					 * If you want to overload this in a child theme then include a file
104
					 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
105
					 */
106
					get_template_part( 'content', get_post_format() );
107
				?>
108
109
			<?php endwhile; ?>
110
111
			<div class="wrap">
112
					<?php the_posts_pagination( array(
113
						'prev_text' => _x( '&#8592;', 'Previous page link', 'strip' ) . '<span class="screen-reader-text">' . __( 'Previous page', 'strip' ) . '</span>',
0 ignored issues
show
Expected a sanitizing function (see Codex for 'Data Validation'), but instead saw '__'
Loading history...
114
						'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'strip' ) . '</span>' . _x( '&#8594;', 'Next post link', 'strip' ),
0 ignored issues
show
Expected a sanitizing function (see Codex for 'Data Validation'), but instead saw '__'
Loading history...
Expected a sanitizing function (see Codex for 'Data Validation'), but instead saw '_x'
Loading history...
115
						'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'strip' ) . ' </span>',
0 ignored issues
show
Expected a sanitizing function (see Codex for 'Data Validation'), but instead saw '__'
Loading history...
116
					) ); ?>
117
	</div>
118
119
		<?php else : ?>
120
121
			<?php get_template_part( 'no-results', 'archive' ); ?>
122
123
		<?php endif; ?>
124
125
		</main><!-- #content -->
126
	</section><!-- #primary -->
127
128
<?php get_sidebar(); ?>
129
<?php get_footer(); ?>
130