This repository has been archived by the owner on Nov 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
88 lines (80 loc) · 2.15 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
<?php
/**
* The template for displaying archive pages
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Cooper
*/
get_header();
?>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-10">
<header>
<?php
the_archive_title( '<h1 class="page-title py-5">', '</h1>' );
?>
</header>
<main id="primary" class="my-3">
<div class="row">
<?php
/* Start the Loop */
while (have_posts()) :
the_post();
if ( has_post_format('image') ) {
?>
<div class="col-4 p-1">
<div class="bg-white p-1 text-dark">
<a href="<?php the_permalink(); ?>">
<?php the_content(); ?>
</a>
<div class="text-dark small">
<?php the_tags('<i class="fa fa-fw fa-tags"></i> ', ', '); ?></div>
<div class="row">
<div class="col-6"> <small class="text-muted">
<relative-time datetime="<?php the_date('c'); ?>" day="numeric" month="long" year="numeric">
<?php the_date(); ?>
</relative-time>
</small></div>
<div class="col-6 text-muted text-end small">
<i class="fa fa-comment"> <?php comments_number('0', '1', '%'); ?></i>
</div>
</div>
</a>
</div>
</div>
<?php
} else { ?>
<div class="col-12 my-2">
<hr />
<?php the_title('<h2 class="h4 pt-2 my-0"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h2>'); ?>
<div class="text-muted">
<relative-time datetime="<?php the_date('c'); ?>" day="numeric" month="long" year="numeric">
<?php the_date(); ?>
</relative-time>
</div>
<div class="py-3">
<?php the_excerpt(); ?>
<p class="text-end">
<a href="<?php the_permalink(); ?>" class="btn btn-link">View Post ></a>
</div>
<div class="d-flex">
<div class="text-muted font-monospace small">
<?php the_tags('<i class="fa fa-fw fa-tags"></i> ', ', '); ?>
<i class="fa fa-comment"> <?php comments_number('0', '1', '%'); ?></i>
</div>
</div>
<hr />
</div>
<?php
};
endwhile; ?>
</div>
<div class="text-end"><?php the_posts_pagination(); ?></div>
</main><!-- #main -->
</div>
</div>
</div>
<?php
get_footer();