Passed
Push — master ( fc82b5...704b83 )
by SILENT
02:25
created

archive-comic.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
 * Template Name: Archive all comics
4
 *
5
 * The template for displaying comic Archives pages
6
 * An overview to peruse all stories — has links to custom comic posts in a second loop
7
 *
8
 * @package WordPress
9
 * @subpackage Strip
10
 */
11
12
get_header(); ?>
13
	<section id="primary"
14
		<main id="content" role="main">
15
16
			<?php if ( have_posts() ) : ?>
17
18
				<header class="page-header">
19
					<h1 class="page-title">
20
						<?php
21
							printf(
22
								esc_html( 'STORIES %s', 'strip' ), '<span>' .
23
								single_cat_title( '', false ) . '</span>'
24
							);
25
						?>
26
					</h1>
27
28
				<?php
29
					// Show an optional term description.
30
					$term_description = term_description();
31
				if ( ! empty( $term_description ) ) :
32
					'<div class="taxonomy-description"' . printf( esc_html( '%s', $term_description ) ) . '</div>';
33
				endif;
34
				?>
35
			</header><!-- .page-header -->
36
37
<?php
38
	// Create and run first loop in reverse order.
39
	$comic = new WP_Query();
40
	$comic = new WP_Query(
41
		array(
42
					'post_type'      => 'comic',
43
					'posts_per_page' => 12, // optional, changes default Blog pages number "reading settings" set in dashboard.
44
					'paged'          => $paged,
45
					'orderby'        => 'title',
46
					'order'          => 'DESC',
47
		)
48
	);
49
50
while ( $comic->have_posts() ) : $comic->the_post();
51
	get_template_part( 'content-comic' );
52
	// change to 'content' to style it like the blog entry page.
53
		?>
54
	<?php endwhile;
55
						wp_reset_postdata(); ?>
56
57
						<div class="wrap">
58
								<?php the_posts_pagination( array(
59
									'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...
60
									'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...
61
									'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...
62
								) ); ?>
63
				</div>
64
65
	<?php else : ?>
66
67
	<?php get_template_part( 'no-results', 'archive-comic' ); ?>
68
69
	<?php endif;
70
			wp_reset_postdata(); ?>
71
72
		</main><!-- #content -->
73
	</section><!-- #primary -->
74
75
<?php get_sidebar(); ?>
76
<?php get_footer(); ?>
77