-
Notifications
You must be signed in to change notification settings - Fork 0
/
taxonomy-countries.php
51 lines (43 loc) · 1.35 KB
/
taxonomy-countries.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
<?php
get_header();
$current_term = get_queried_object()->name;
$queried_object = get_queried_object();
$taxonomy = $queried_object->taxonomy;
$term_id = $queried_object->term_id;
$image = get_field('image', $taxonomy . '_' . $term_id )
?>
<div class="container">
<div class="row wide-gutter-row">
<div class="col-lg-offset-2 col-lg-8 wide-gutter-col">
<h1 class="page-heading"><?= $current_term ?></h1>
<?php if ( category_description() ) : ?>
<?php if (!$image) : ?>
<section>
<?= wpautop( category_description() ); ?>
</section>
<hr>
<?php else : ?>
<div class="row">
<div class="col-sm-8">
<?= wpautop( category_description() ); ?>
</div>
<div class="col-sm-4">
<img class="img-responsive" src="<?= $image['sizes']['medium'] ?>">
</div>
</div>
<hr>
<?php endif ?>
<?php endif ?>
<?php if (have_posts()) : $i=0; while ( have_posts() ) : the_post(); ?>
<?php if ($i !== 0 ) : ?><hr><?php endif ?>
<article class="media">
<h3><a href="<?php echo get_permalink() ?>"><?php echo get_the_title() ?></a></h3>
<p class="medium-heavy"><?php echo get_the_date() ?></p>
<p class="margin-top-10"><?php echo wp_trim_words(get_the_excerpt()) ?></p>
</article>
<?php $i++; endwhile; endif; ?>
<?php wp_pagenavi(); ?>
</div>
</div>
</div>
<?php get_footer();?>