-
Notifications
You must be signed in to change notification settings - Fork 0
/
loop-tools.php
38 lines (33 loc) · 1.08 KB
/
loop-tools.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
<?php
$terms = get_the_terms(get_the_ID(), 'tool_type');
?>
<!-- article -->
<article id="post-<?php the_ID(); ?>" <?php post_class('col-12 col-md-4 mb-3'); ?>>
<div class="card h-100 d-flex flex-column">
<?php if(has_post_thumbnail()) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail( 'horz-thumbnail-lg', array('class' => 'card-img-top') ); ?>
</a>
<?php endif; ?>
<div class ="card-body">
<?php
if($terms):
echo '<div class="terms-list">';
foreach ($terms as $key => $term) :
echo $term->name;
if(next($terms)) :
echo ', ';
endif;
endforeach;
echo '</div>';
endif;
echo '<h5 class="post-title">';
echo '<a href="' . get_the_permalink() . '" title="' . the_title_attribute(array('echo' => false)) . '">';
the_title();
echo '</a>';
echo '</h5>';
?>
<?php the_field('short_description'); ?>
</div>
</div>
</article>