forked from OpenDevelopmentMekong/wp-odm_theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-topic.php
98 lines (84 loc) · 3.08 KB
/
archive-topic.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
<?php get_header();
$options = get_option('odm_options');
$date_to_show = isset($options['single_page_date']) ? $options['single_page_date'] : "metadata_created"; ?>
<div class="section-title main-title">
<section class="container">
<header class="row">
<div class="eight columns">
<h1 class="ellipsis"><?php _e('Topics','odm') ?></h1>
</div>
<div class="eight columns align-right">
<?php get_template_part('section', 'query-actions'); ?>
</div>
</header>
</section>
<section class="container">
<div class="row">
<div class="sixteen columns filter-container">
<div class="panel more-filters-content row">
<?php
$filter_arg = array(
'search_box' => true,
'cat_selector' => true,
'con_selector' => false,
'date_rang' => true,
'post_type' => get_post_type()
);
odm_adv_nav_filters($filter_arg);
?>
</div>
</div>
</div>
<div class="row">
<div class="sixteen columns">
<?php
$taxonomy_categories_1 = array("agriculture-and-fishing", "disaster-and-emergency-response", "environment-and-natural-resources", "extractive-industries", "land");
$taxonomy_categories_2 = array("economy-and-commerce", "energy", "industry", "infrastructure", "labor", "science-and-technology");
$taxonomy_categories_3 = array("aid-and-development", "government", "law-and-judiciary", "population-and-censuses", "social-development", "urban-administration-and-development"); ?>
<h3 class="clearfix"><?php _e('Environment and land','odm'); ?></h3>
<?php
while (have_posts()) : the_post();
$post = get_post();
$top_level_cat_names = get_top_level_category_slugs(get_the_category($post->ID));
if (arrays_have_common_items($top_level_cat_names,$taxonomy_categories_1)):
odm_get_template('post-grid-single-4-cols',array(
"post" => $post,
"show_meta" => true,
"meta_fields" => array("date"),
"order" => $date_to_show
),true);
endif;
endwhile;
rewind_posts(); ?>
<h3 class="clearfix"><?php _e('Economy','odm'); ?></h3>
<?php
while (have_posts()) : the_post();
$post = get_post();
$top_level_cat_names = get_top_level_category_slugs(get_the_category($post->ID));
if (arrays_have_common_items($top_level_cat_names,$taxonomy_categories_2)):
odm_get_template('post-grid-single-4-cols',array(
"post" => $post,
"show_meta" => true,
"order" => $date_to_show
),true);
endif;
endwhile;
rewind_posts(); ?>
<h3 class="clearfix"><?php _e('People','odm'); ?></h3>
<?php
while (have_posts()) : the_post();
$post = get_post();
$top_level_cat_names = get_top_level_category_slugs(get_the_category($post->ID));
if (arrays_have_common_items($top_level_cat_names,$taxonomy_categories_3)):
odm_get_template('post-grid-single-4-cols',array(
"post" => $post,
"show_meta" => true,
"order" => $date_to_show
),true);
endif;
endwhile; ?>
</div>
</div>
</section>
</div>
<?php get_footer(); ?>