-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive.php
More file actions
82 lines (66 loc) · 2.33 KB
/
Copy patharchive.php
File metadata and controls
82 lines (66 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
/**
* Template for displaying archive pages.
*
* Used for date-based, author, and custom post-type archives. Renders the
* archive title and optional description, iterates over posts using the
* appropriate post-format template part, and outputs pagination links.
* Falls back to content-none.php when the query returns no posts.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
* @package Canard
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
get_header(); ?>
<div class="site-content-inner">
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<?php
the_archive_title( '<h1 class="page-title">', '</h1>' );
/*
* Security: the_archive_description() does not apply wp_kses_post()
* to the taxonomy term description field. Users with the
* manage_categories capability can store arbitrary HTML in that field.
* Use get_the_archive_description() + wp_kses_post() to strip script
* tags and other dangerous markup before output.
* See also: the get_the_archive_description filter in functions.php.
*/
$archive_desc = get_the_archive_description();
if ( $archive_desc ) {
echo '<div class="taxonomy-description">' . wp_kses_post( $archive_desc ) . '</div>';
}
?>
</header><!-- .page-header -->
<?php while ( have_posts() ) : the_post(); ?>
<?php
/*
* Include the post-format-specific template part.
* To override in a child theme, create content-{format}.php.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php
/*
* Security: esc_html__() is used instead of __() so that pagination
* link labels are treated as plain text and cannot carry markup from
* a compromised translation file.
*/
the_posts_pagination( [
'mid_size' => 2,
'prev_text' => esc_html__( '← Previous', 'canard' ),
'next_text' => esc_html__( 'Next →', 'canard' ),
] ); ?>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
</div><!-- .site-content-inner -->
<?php get_footer(); ?>