-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive-disabled.oldphp
156 lines (116 loc) · 3.7 KB
/
archive-disabled.oldphp
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
154
155
156
<?php
/**
* Issue filtering.
*
* If issue string parameter is provided,
* show only connected posts or calendars.
$main_query = [
'post_type' => [],
'orderby' => 'post_date',
'order' => 'DESC'
];
if (is_post_type_archive ([ 'product' ]))
{
$pass = false;
$main_query ['post_type'][] = 'product';
} */
/*if (is_post_type_archive([ 'calendar' ]))
{
exit ('In cal');
$pass = false;
$main_query ['post_type'][] = 'calendar';
}*/
/*
if ($_GET['issue'])
$main_query['tax_query'][] = [
'taxonomy' => 'magazine',
'field' => 'slug',
'terms' => [$issue->slug]
];
if (!$pass)
{
//global $dynamics;
$dynamics = new WP_Query($main_query);
}
*/
?>
<?php if (!have_posts()) : ?>
<div class="alert alert-warning">
<?php _e('Sorry, no results were found.', 'sage'); ?>
</div>
<?php get_search_form(); ?>
<?php endif; ?>
<div class="row">
<?php
/* if Productivity */
if (is_post_type_archive(array( 'product' ))) {
// Could use a bit more DRY
if (isset ($dynamics))
{ ?>
<?php if (have_posts()) : ?>
<div data-columns="" id="columns">
<?php while ($dynamics->have_posts()) : $dynamics->the_post(); ?>
<?php get_template_part('templates/content-productivity', 'product'); ?>
<?php endwhile; ?>
</div>
<?php endif; ?>
<?php } else { ?>
<?php if (have_posts()) : ?>
<div data-columns="" id="columns">
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('templates/content-productivity', get_post_type() != 'product' ? get_post_type() : get_post_format()); ?>
<?php endwhile; ?>
</div>
<?php endif; ?>
<?php } ?>
<?php }
/* If Magazine Taxonomy */
elseif (is_tax(array( 'magazine' ))) { ?>
<?php if( !is_paged() ) { ?>
<?php get_template_part('templates/snippet-magazine-description'); ?>
<?php } ?>
<div class="all-articles">
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('templates/content-magazine', get_post_type() != 'post' ? get_post_type() : get_post_format()); ?>
<?php endwhile; ?>
</div>
<?php }
/* If Calendar */
elseif (is_post_type_archive(array( 'calendar' ))) {
// Could use a bit more DRY
/* if (isset ($dynamics))
{
exit ('In cal');
?>
<?php if (have_posts()) : ?>
<div data-columns="" id="columns-calendar">
<?php while ($dynamics->have_posts()) : $dynamics->the_post(); ?>
<?php get_template_part('templates/content-calendar', get_post_type() != 'calendar' ? get_post_type() : get_post_format()); ?>
<?php endwhile; ?>
</div>
<?php endif; ?>
<?php } else { ?>
<?php if (have_posts()) : ?>
<div data-columns="" id="columns-calendar">
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('templates/content-calendar', get_post_type() != 'calendar' ? get_post_type() : get_post_format()); ?>
<?php endwhile; ?>
</div>
<?php endif; ?>
<?php } */ ?>
<?php if (have_posts()) : ?>
<div data-columns="" id="columns-calendar">
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('templates/content-calendar', get_post_type() != 'calendar' ? get_post_type() : get_post_format()); ?>
<?php endwhile; ?>
</div>
<?php endif; ?>
<?php }
/* Else if all others */
else { ?>
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('templates/content-archive', get_post_type() != 'post' ? get_post_type() : get_post_format()); ?>
<?php endwhile; ?>
<?php } ?>
</div>
<?php get_template_part('templates/page-navi'); ?>