Completed
Push — master ( 1d9c94...5b5429 )
by SILENT
02:22
created

archive-comic.php (1 issue)

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
					<h2 class="taxonomy-description">
29
						<a href="<?php echo esc_url( home_url( '/series/' ) ); ?>">
30
						<?php '<span class="meta-nav"' . printf( esc_html_e( 'Series', 'strip' ) ) . '</span>'; ?>
31
						</a>
32
					</h2>
33
34
					<h4 class="series-title">
35
					<a href="<?php echo esc_url( home_url( '/story/exile/' ) ); ?>">ExIle</a></h4>
36
					<h4 class="series-title">
37
					<a href="<?php echo esc_url( home_url( '/story/tofu/' ) ); ?>">Morning Tofu Chase</a></h4>
38
					<h3 class="series-title">
39
					<a href="<?php echo esc_url( home_url( '/story/sentient-drone/' ) ); ?>">Sentient Drone</a></h3>
40
41
				<?php
42
					// Show an optional term description.
43
					$term_description = term_description();
44
				if ( ! empty( $term_description ) ) :
45
					'<div class="taxonomy-description"' . printf( esc_html( '%s', $term_description ) ) . '</div>';
46
				endif;
47
				?>
48
			</header><!-- .page-header -->
49
50
<?php
51
	// Create and run first loop in reverse order.
52
	$comic = new WP_Query();
53
	$comic = new WP_Query(
54
		array(
55
					'post_type'      => 'comic',
56
					'posts_per_page' => 12, // optional, changes default Blog pages number "reading settings" set in dashboard.
57
					'paged'          => $paged,
58
					'orderby'        => 'title',
59
					'order'          => 'DESC',
60
		)
61
	);
62
63
while ( $comic->have_posts() ) : $comic->the_post();
64
	get_template_part( 'content-comic' );
65
	// change to 'content' to style it like the blog entry page.
66
		?>
67
	<?php endwhile;
68
						wp_reset_postdata(); ?>
69
70
		<?php strip_content_nav( 'nav-below' ); ?>
0 ignored issues
show
'nav-below' is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
71
72
	<?php else : ?>
73
74
	<?php get_template_part( 'no-results', 'archive-comic' ); ?>
75
76
	<?php endif;
77
			wp_reset_postdata(); ?>
78
79
		</main><!-- #content -->
80
	</section><!-- #primary -->
81
82
<?php get_sidebar(); ?>
83
<?php get_footer(); ?>
84