forked from OpenDevelopmentMekong/wp-odm_theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive-map-layer.php
More file actions
96 lines (84 loc) · 3.17 KB
/
archive-map-layer.php
File metadata and controls
96 lines (84 loc) · 3.17 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
<?php get_header();?>
<div class="section-title main-title">
<section class="container">
<header class="row">
<div class="eight columns">
<h1><?php _e('Maps catalog','odm') ?></h1>
</div>
<div class="eight columns">
<?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(),
'taxonomy' => "layer-category",
'depth' => 1
);
odm_adv_nav_filters($filter_arg);
?>
</div>
</div>
</div>
<div class="row">
<div class="sixteen columns">
<?php
//get id of base-layer and map-catalogue category for excluding
$search_string = isset($_GET['filter_s'])? $_GET['filter_s'] : null;
$filter_date_start = isset($_GET['filter_date_start'])? $_GET['filter_date_start'] : null;
$filter_date_end = isset($_GET['filter_date_end'])? $_GET['filter_date_end'] : null;
$filter_category = isset($_GET['filter_category'])? $_GET['filter_category'] : null;
$filter_post_type = isset($_GET['filter_post_type'])? $_GET['filter_post_type'] : null;
$filter_taxonomy = isset($_GET['filter_taxonomy'])? $_GET['filter_taxonomy'] : null;
$filter_layer = array(
'filter_s' => $search_string,
'filter_category' => $filter_category,
'filter_taxonomy' => $filter_taxonomy,
'filter_post_type' => $filter_post_type,
'filter_date_start' => $filter_date_start,
'filter_date_end' => $filter_date_end
);
$cat_baselayers = 'base-layers';
$term_baselayers = get_term_by('slug', $cat_baselayers, 'layer-category');
$cat_baselayers_id = $term_baselayers->term_id;
$cat_map_catalogue = 'map-catalogue';
$term_map_catalogue = get_term_by('slug', $cat_map_catalogue, 'layer-category');
$cat_map_catalogue_id = $term_map_catalogue->term_id;
$exclude_posts_in_cats = array($cat_baselayers_id, $cat_map_catalogue_id);
//List cetegory and layer by cat for menu items
$map_catalogue = get_all_layers_grouped_by_subcategory(0, $exclude_posts_in_cats, $filter_layer);
$pagination = get_pagination_of_layers_grouped_by_subcategory($map_catalogue);
foreach ($map_catalogue as $key => $layer) {
$started_index = $key +1;
if($started_index >= $pagination["start_post"]):
odm_get_template('post-grid-single-4-cols',array(
"post" => $layer,
"show_meta" => false)
, true);
endif;
if($started_index == $pagination["end_post"]):
break;
endif;
}
?>
</div>
</div>
</section>
<section class="container">
<div class="row">
<div class="sixteen columns">
<?php odm_get_template('pagination', array("paging_arg" => $pagination["paging_arg"]), true); ?>
</div>
</div>
</section>
</div>
<?php get_footer(); ?>