/
archive-map-layer.php
101 lines (88 loc) · 3.29 KB
/
archive-map-layer.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
<?php get_header();
$options = get_option('odm_options');
$date_to_show = isset($options['single_page_date']) ? $options['single_page_date'] : "metadata_created"; ?>
<section class="container section-title main-title">
<header class="row">
<div class="eight columns">
<h1 class="ellipsis"><?php _e('Maps catalog','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
$cat_baselayers = 'base-layers';
$cat_map_catalogue = 'map-catalogue';
$layer_category = 'layer-category';
$term_baselayers = get_term_by('slug', $cat_baselayers, $layer_category);
$cat_baselayers_id = $term_baselayers->term_id;
$term_map_catalogue = get_term_by('slug', $cat_map_catalogue, $layer_category);
$cat_map_catalogue_id = $term_map_catalogue->term_id;
$filter_arg = array(
'search_box' => true,
'cat_selector' => true,
'con_selector' => false,
'date_rang' => true,
'post_type' => get_post_type(),
'taxonomy' => "layer-category",
'exclude_cat_id' => $cat_map_catalogue_id,
'depth' => 1
);
odm_adv_nav_filters($filter_arg);
?>
</div>
</div>
</div>
<div class="row">
<div class="sixteen columns">
<?php
$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
);
//List cetegory and layer by cat for menu items
$map_catalogue = get_all_layers_grouped_by_subcategory(0, null, $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,
"meta_fields" => array("date"),
"view_large_image" => true,
"order" => $date_to_show
)
, 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>
<?php get_footer(); ?>