-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patharchive.php
More file actions
executable file
·153 lines (113 loc) · 4.94 KB
/
archive.php
File metadata and controls
executable file
·153 lines (113 loc) · 4.94 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php
get_header();
?>
<main id="main-content" class="site-main all-posts"role="main">
<?php if (have_posts()) : ?>
<!-- HEADER -->
<section class="container-wrapper bg-color-warm-gray-800 header-bg" >
<div class="container article-header no-hero-image">
<div class="row justify-center" >
<div class="section-header col col-12">
<div class="section-header-title">
<?php the_archive_title('<h1 class="page-title">', '</h1>'); ?>
<div class="header-subtitle"><?php echo term_description(); ?></div>
</div><!-- / section-header-title -->
</div><!-- / section-header -->
</div><!-- / row -->
</div><!-- / container -->
</section><!-- / container-wrapper -->
<!-- ARTICLE -->
<div class="container-wrapper container-padding-top container-padding-bottom bg-color-warm-gray-200" >
<div class="container ">
<div class="row justify-center">
<div class="col col-10 cms-content" >
<?php
$queried_object = get_queried_object();
if (is_category()) {
// Category archive
$category_id = $queried_object->term_id;
echo do_shortcode('[ajax_load_more
post_type="post"
category="' . esc_attr($queried_object->slug) . '"
posts_per_page="8"
scroll="true" pause="false" loading_style="infinite fading-squares" scroll_distance="50"
container_type="div"
button_label="More Articles"]');
} elseif (is_tag()) {
// Tag archive
$tag_id = $queried_object->term_id;
echo do_shortcode('[ajax_load_more
post_type="post"
tag="' . esc_attr($queried_object->slug) . '"
posts_per_page="8"
scroll="true" pause="false" loading_style="infinite fading-squares" scroll_distance="50"
container_type="div"
button_label="More Articles"]');
} elseif (is_tax()) {
// Custom taxonomy archive
$tax_slug = $queried_object->taxonomy;
$term_slug = esc_attr($queried_object->slug);
echo do_shortcode('[ajax_load_more
post_type="post"
taxonomy="' . $tax_slug . '"
taxonomy_terms="' . $term_slug . '"
taxonomy_operator="IN"
posts_per_page="8"
scroll="true" pause="false" loading_style="infinite fading-squares" scroll_distance="50"
container_type="div"
button_label="More Articles"]');
} elseif (is_author()) {
// Author archive
$author_id = get_queried_object_id();
echo do_shortcode('[ajax_load_more
author="' . $author_id . '"
posts_per_page="8"
scroll="false"
container_type="div"
button_label="More Articles"]');
} elseif (is_date()) {
// Date archive
echo do_shortcode('[ajax_load_more
year="' . get_query_var('year') . '"
month="' . get_query_var('monthnum') . '"
day="' . get_query_var('day') . '"
posts_per_page="8"
scroll="true" pause="false" loading_style="infinite fading-squares" scroll_distance="50"
container_type="div"
button_label="More Articles"]');
} else {
// Default archive fallback
echo do_shortcode('[ajax_load_more
posts_per_page="8"
scroll="true" pause="false" loading_style="infinite fading-squares" scroll_distance="50"
container_type="div"
button_label="More Articles"]');
}
?>
<?php else : ?>
<!-- HEADER -->
<section class="container-wrapper bg-color-warm-gray-800 header-bg" >
<div class="container article-header no-hero-image">
<div class="row justify-center" >
<div class="section-header col col-12">
<div class="section-header-title">
<h1>Nothing Found</h1>
<div class="header-subtitle">Use the search tool above, or <a href="<?php echo home_url(); ?>">visit our homepage</a></div>
</div><!-- / section-header-title -->
</div><!-- / section-header -->
</div><!-- / row -->
</div><!-- / container -->
</section><!-- / container-wrapper -->
<!-- ARTICLE -->
<div class="container-wrapper container-padding-top container-padding-bottom bg-color-warm-gray-200" >
<div class="container ">
<div class="row justify-center">
<div class="col col-10 all-posts cms-content" >
<?php endif; ?>
</div><!-- / col -->
</div><!-- / row -->
</div><!-- / container -->
</div><!-- / container wrapper -->
</main><!-- / main -->
<?php
get_footer();