-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive.php
More file actions
80 lines (66 loc) · 2.34 KB
/
archive.php
File metadata and controls
80 lines (66 loc) · 2.34 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
<?php
/**
* The archive template.
*
* Used when a category, author, or date is queried.
*/
get_header(); ?>
<?php if ( have_posts() ) : ?>
<section class="container blog">
<div class="row">
<div class="sm-col-11 col-10 col-centered">
<div class="blog__header text-center">
<h1>Blog</h1>
</div>
</div>
</div>
<div class="row">
<div class="sm-col-11 col-11 col-centered">
<?php while ( have_posts() ) : the_post(); ?>
<div class="row row--align-items-center blog__single-row">
<?php
// variables
$thumbnail = get_the_post_thumbnail();
if ( $alt_text = get_the_post_thumbnail_caption() ) {
// Nothing to do here
} else {
$alt_text = get_the_title();
}
if ( empty($thumbnail) ) :
?>
<div class="sm-col-12 md-col-10 col-3 col-centered">
<a href="<?php echo get_permalink(); ?>">
<img src="<?php echo get_stylesheet_directory_uri(); ?>/assets/img/defendry-tagline-dark.svg" alt="Defendry Logo" />
</a>
</div>
<?php else : ?>
<div class="sm-col-12 md-col-10 col-3 col-centered">
<a class="no-underline" href="<?php echo get_permalink(); ?>">
<img src="<?php the_post_thumbnail_url( 'full' ); ?>" alt="<?php echo $alt_text; ?>" />
</a>
</div>
<?php endif; ?>
<div class="sm-col-12 md-col-10 col-8 offset-1 col-centered">
<a href="<?php echo get_permalink(); ?>">
<h2 class="blog__single-row__title">
<?php the_title(); ?>
</h2>
<h6>
<?php the_date(); ?>
</h6>
</a>
<p>
<?php echo get_the_excerpt(); ?>
</p>
<a class="button button--primary" href="<?php echo get_permalink(); ?>">Read More</a>
</div>
</div>
<?php endwhile; ?>
<?php the_posts_pagination();
else :
echo '<h2>Sorry, no posts have been found</h2>'; ?>
</div>
</div>
</section>
<?php endif;
get_footer();