/
archive.php
127 lines (96 loc) · 3.93 KB
/
archive.php
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?php
/**
* The template for displaying Archive pages
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Strip
*/
get_header(); ?>
<div id="primary"
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<div class="wrap">
<h1 class="page-title">
<?php
if ( is_author() && get_the_author_meta( 'description' ) ) {
echo '<div class="author-index shorter">';
get_template_part( 'inc/author','box' );
echo '</div>';
}
?>
<?php
if ( is_category() ) :
printf( esc_html__( 'Category Archives: %s', 'strip' ), '<span>' . single_cat_title( '', false ) . '</span>' );
elseif ( is_tag() ) :
printf( esc_html__( 'Tag Archives: %s', 'strip' ), '<span>' . single_tag_title( '', false ) . '</span>' );
elseif ( is_author() ) :
printf( esc_html__( 'All articles by %s', 'strip' ), '<span class="vcard">' . get_the_author() . '</span>' );
elseif ( is_day() ) :
printf( esc_html__( 'Daily Archives: %s', 'strip' ), '<span>' . get_the_date() . '</span>' );
elseif ( is_month() ) :
printf( esc_html__( 'Monthly Archives: %s', 'strip' ), '<span>' . get_the_date( 'F Y' ) . '</span>' );
elseif ( is_year() ) :
printf( esc_html__( 'Yearly Archives: %s', 'strip' ), '<span>' . get_the_date( 'Y' ) . '</span>' );
elseif ( is_tax( 'post_format', 'post-format-aside' ) ) :
esc_html_e( 'Asides', 'strip' );
elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) :
esc_html_e( 'Galleries', 'strip' );
elseif ( is_tax( 'post_format', 'post-format-image' ) ) :
esc_html_e( 'Images', 'strip' );
elseif ( is_tax( 'post_format', 'post-format-video' ) ) :
esc_html_e( 'Videos', 'strip' );
elseif ( is_tax( 'post_format', 'post-format-quote' ) ) :
esc_html_e( 'Quotes', 'strip' );
elseif ( is_tax( 'post_format', 'post-format-link' ) ) :
esc_html_e( 'Links', 'strip' );
elseif ( is_tax( 'post_format', 'post-format-audio' ) ) :
esc_html_e( 'Audios', 'strip' );
elseif ( is_tax( 'post_format', 'post-format-chat' ) ) :
esc_html_e( 'Chats', 'strip' );
elseif ( is_tax( 'story', 'story_term' ) ) :
esc_html_e( 'Stories', 'strip' );
get_template_part( 'archive-comic' );
elseif ( ! 'comic' === get_post_type() ) :
esc_html_e( 'Comics', 'strip' );
else :
esc_html_e( 'Archives', 'strip' );
endif;
?>
</h1>
<?php
// Show an optional term description.
$term_description = term_description();
if ( ! empty( $term_description ) ) :
echo '<div class="taxonomy-description">';
echo term_description();
echo '</div>';
endif;
?>
</div><!-- .wrap -->
</header><!-- .page-header -->
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/*
Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php the_posts_pagination( array(
'prev_text' => _x( '←', 'Previous page link', 'strip' ) . '<span class="screen-reader-text">' . __( 'Previous page', 'strip' ) . '</span>',
'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'strip' ) . '</span>' . _x( '→', 'Next post link', 'strip' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'strip' ) . ' </span>',
) ); ?>
<?php else : ?>
<?php get_template_part( 'no-results', 'archive' ); ?>
<?php endif; ?>
</main><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>