-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-resources.php
57 lines (45 loc) · 1.35 KB
/
archive-resources.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
<?php
$post_type = is_page_template( 'template-archive-events.php' ) ? 'tribe_events' : get_post_type();
$tab_taxonomies = array(
'tribe_events' => 'tribe_events_cat',
'resources' => 'resources_category',
);
$taxonomy = $tab_taxonomies[ $post_type ];
$terms = 'tribe_events' !== $post_type
? get_terms( $taxonomy )
: array(
(object) [
'name' => 'Upcoming',
'slug' => 'upcoming',
'order' => 'ASC',
'start_date' => 'today',
'end_date' => '',
],
(object) [
'name' => 'Past',
'slug' => 'past',
'order' => 'DESC',
'start_date' => '',
'end_date' => 'today',
],
);
?>
<?php if ( 'tribe_events' === $post_type ) : ?>
<?php acf_form_head(); ?>
<?php endif; ?>
<?php get_header(); ?>
<article class="flex-1">
<div class="base-col">
<?php set_query_var( 'post_type', $post_type ); ?>
<?php set_query_var( 'taxonomy', $taxonomy ); ?>
<?php set_query_var( 'terms', $terms ); ?>
<?php get_template_part( 'template-parts/archive/header' ); ?>
<?php get_template_part( 'template-parts/archive/aside', $post_type ); ?>
<?php get_template_part( 'template-parts/archive/content' ); ?>
</div>
<?php // <div class="col"></div> ?>
</article>
<?php if ( 'tribe_events' === $post_type ) : ?>
<?php get_template_part( 'template-parts/forms/index' ); ?>
<?php endif; ?>
<?php get_footer(); ?>