forked from OpenDevelopmentMekong/wp-odm_theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive-post.php
107 lines (92 loc) · 3.34 KB
/
archive-post.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
102
103
104
105
106
107
<?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><?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">
<h3 class="clearfix"><?php _e('Environment and land','odm'); ?></h3>
<?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 cencuses", "Social development", "Urban administration and development");
while (have_posts()) : the_post();
$post = get_post();
$category = get_the_category($post->ID);
if(isset($category[0]->cat_ID)):
$top_level_cat = get_top_level_category_english_name($category[0]->cat_ID);
if (in_array($top_level_cat,$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;
endif;
endwhile; ?>
<?php rewind_posts(); ?>
<h3 class="clearfix"><?php _e('Economy','odm'); ?></h3>
<?php
while (have_posts()) : the_post();
$post = get_post();
$category = get_the_category($post->ID);
if(isset($category[0]->cat_ID)):
$top_level_cat = get_top_level_category_english_name($category[0]->cat_ID);
if (in_array($top_level_cat,$taxonomy_categories_2)):
odm_get_template('post-grid-single-4-cols',array(
"post" => $post,
"show_meta" => true,
"order" => $date_to_show
),true);
endif;
endif;
endwhile; ?>
<?php rewind_posts(); ?>
<h3 class="clearfix"><?php _e('People','odm'); ?></h3>
<?php
while (have_posts()) : the_post();
$post = get_post();
$category = get_the_category($post->ID);
if(isset($category[0]->cat_ID)):
$top_level_cat = get_top_level_category_english_name($category[0]->cat_ID);
if (in_array($top_level_cat,$taxonomy_categories_3)):
odm_get_template('post-grid-single-4-cols',array(
"post" => $post,
"show_meta" => true,
"order" => $date_to_show
),true);
endif;
endif;
endwhile; ?>
</div>
</div>
</section>
</div>
<?php get_footer(); ?>