-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive.php
More file actions
executable file
·50 lines (45 loc) · 1.55 KB
/
archive.php
File metadata and controls
executable file
·50 lines (45 loc) · 1.55 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
<?php
/**
* The archive template.
*
* Used when a category, author, or date is queried.
*/
get_header();
?>
<section>
<?php if ( have_posts() ) : ?>
<?php $post = $posts[ 0 ]; ?>
<div>
<?php if ( is_category() ) : ?>
<h2>Archive for the ‘<?php single_cat_title(); ?>’ Category</h2>
<?php elseif ( is_tag() ) : ?>
<h2>Posts Tagged ‘<?php single_tag_title(); ?>’</h2>
<?php elseif ( is_day() ) : ?>
<h2>Archive for <?php the_time( 'F jS, Y' ); ?></h2>
<?php elseif ( is_month() ) : ?>
<h2>Archive for <?php the_time( 'F, Y' ); ?></h2>
<?php elseif ( is_year() ) : ?>
<h2 class="pagetitle">Archive for <?php the_time( 'Y' ); ?></h2>
<?php elseif ( is_author() ) : ?>
<h2 class="pagetitle">Author Archive</h2>
<?php elseif ( isset($_GET[ 'paged' ]) && !empty($_GET[ 'paged' ]) ) : ?>
<h2 class="pagetitle">Blog Archives</h2>
<?php endif; ?>
<?php while ( have_posts() ) : the_post(); ?>
<div <?php post_class(); ?>>
<h2 id="post-<?php the_ID(); ?>"><a
href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php
get_template_part( 'parts/meta' );
the_content();
?>
</div>
<?php endwhile; ?>
<?php the_posts_pagination( array('mid_size' => 2) ); ?>
</div>
<?php else : ?>
<h2>Nothing found</h2>
<?php endif; ?>
</section>
<?php
get_footer();