-
Notifications
You must be signed in to change notification settings - Fork 3
/
taxonomy-ground_catalog_taxonomy.php
101 lines (77 loc) · 2.26 KB
/
taxonomy-ground_catalog_taxonomy.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
/**
* Taxonomy ground_catalog_taxonomy
*
* @package Ground
*/
get_template_part( 'partials/header' );
?>
<div class="container">
<div class="row">
<?php get_template_part( 'partials/breadcrumbs' ); ?>
<div class="gr-12 gr-3@md">
<?php get_template_part( 'partials/sidebar', 'secondary' ); ?>
</div>
<div class="gr-12 gr-9@md">
<section class="page page--catalog-archive">
<header class="page__header">
<h1 class="page__title"><?php single_cat_title(); ?></h1>
</header>
<div class="page__body">
<?php
the_archive_description();
$queried_object = get_queried_object();
$term_id = $queried_object->term_id;
$args = array(
'child_of' => $term_id,
'hide_empty' => 1,
'hierarchical' => 0,
'parent' => $term_id,
'taxonomy' => 'ground_catalog_taxonomy',
);
$catalog_taxonomies = get_categories( $args );
// Categories.
if ( ! empty( $catalog_taxonomies ) && ! is_wp_error( $catalog_taxonomies ) ) :
?>
<div class="row">
<?php
foreach ( $catalog_taxonomies as $catalog_taxonomy ) :
?>
<div class="gr-12 gr-4@md">
<?php
$args = array(
'slug' => $catalog_taxonomy->slug,
'name' => $catalog_taxonomy->name,
'description' => $catalog_taxonomy->description,
);
get_template_part( 'partials/abstract', 'taxonomy-ground_catalog', $args );
?>
</div>
<?php endforeach ?> <!-- End .row -->
</div>
<?php
else : // Products.
if ( have_posts() ) :
?>
<div class="row">
<?php
while ( have_posts() ) :
the_post();
?>
<div class="gr-12 gr-4@md">
<?php get_template_part( 'partials/abstract', 'ground_catalog' ); ?>
</div>
<?php endwhile; ?>
</div> <!-- End .row -->
<?php
get_template_part( 'partials/pagination' );
endif;
endif;
?>
</div> <!-- End .page__body -->
</section> <!-- End .page -->
</div>
</div> <!-- End .row -->
</div> <!-- End .container -->
<?php
get_template_part( 'partials/footer' );