-
Notifications
You must be signed in to change notification settings - Fork 0
/
categories-archive-section.php
39 lines (34 loc) · 1.51 KB
/
categories-archive-section.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
<div class="inner-content-area product-list-sec">
<div class="text-area">
<h2><?php the_sub_field('archive_section_title'); ?></h2>
<?php
if( get_sub_field('show_call_number') ) { ?>
<h3>Call to find out more: <a href="tel:<?php the_sub_field('phone_number'); ?>" title="Call us"><?php the_sub_field('phone_number'); ?></a></h3>
<?php } ?>
<?php
if( get_sub_field('subtitle_text') ) { ?>
<p><?php the_sub_field('subtitle_text'); ?></p>
<?php } ?>
<?php
$taxonomyname = get_sub_field('archive_taxonomy_slug');
$terms = get_terms( $taxonomyname, array(
'hide_empty' => false,
) ); ?>
<!-- the category archive section -->
<div class="text-center product-clik">
<?php
foreach ( $terms as $term ) {
$term_url = get_term_link( $term ); ?>
<a class="product-img" href="<?php echo $term_url; ?>" title="<?php echo $term->name ; ?>">
<img src="<?php the_field('featured_image', $term->taxonomy . '_' . $term->term_id); ?>">
</a>
<?php
// echo $term->name . '<br>' ;
// echo $term->slug .'<br>';
// echo get_term_link( $term ). '<br>';
}
?>
</div>
<!-- end category archive section-->
</div>
</div>