-
Notifications
You must be signed in to change notification settings - Fork 1
/
archive.php
62 lines (48 loc) · 1.95 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
<?php
/**
* The template for displaying archive pages.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package medium_magazin_beta
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?>
<div class="row">
<header class="page-header col-12 p-3 mb-4 text-center" style="background-color: <?php echo mmbeta_color('petrol'); ?>">
<?php
single_term_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' );
?>
</header><!-- .page-header -->
</div>
<div class="d-flex justify-content-center flex-row flex-wrap">
<?php while ( have_posts() ) : the_post(); ?>
<article class="container col-12 col-md-10 col-lg-8 d-flex flex-row flex-wrap justify-content-center">
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' ); ?>
<?php if ($image): ?>
<div class="col-12 col-md-4 d-flex justify-content-center">
<a class="img-link" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<figure class="figure">
<?php echo wp_get_attachment_image(get_post_thumbnail_id( $post->ID ), 'cover', false, array('class' => 'img-responsive figure-img') ); ?>
</figure>
</a>
</div>
<?php endif; ?>
<div class="col-12 col-md-8">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<h2><?php the_title(); ?></h2>
</a>
<div class="lead"><?php the_excerpt(); ?></div>
</div>
</article>
<?php endwhile; ?>
</div>
<?php else : ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_footer(); ?>