forked from InfoAmazonia/infocongo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
content-map-group.php
66 lines (66 loc) · 1.94 KB
/
content-map-group.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
<?php
$mapgroup = jeo_get_mapgroup_data();
$main_maps = $more_maps = array();
// separate main maps from "more" maps
if(is_array($mapgroup['maps'])) {
foreach($mapgroup['maps'] as $map) {
if(!isset($map['more']))
$main_maps[] = $map;
else
$more_maps[] = $map;
}
}
?>
<div class="mapgroup-container">
<div id="mapgroup_<?php echo jeo_get_the_ID(); ?>" class="mapgroup">
<ul class="map-nav">
<?php
foreach($main_maps as $map) :
$post = get_post($map['id']);
setup_postdata($post);
?>
<li><a href="<?php the_permalink(); ?>" data-map="<?php the_ID(); ?>"><?php the_title(); ?></a></li>
<?php
wp_reset_postdata();
endforeach; ?>
<?php if($more_maps) : ?>
<li class="more-tab">
<a href="#" class="toggle-more"><?php _e('More...', 'infoamazonia'); ?></a>
<ul class="more-maps-list">
<?php foreach($more_maps as $map) :
$post = get_post($map['id']);
setup_postdata($post);
?>
<li class="more-item"><a href="<?php the_permalink(); ?>" data-map="<?php the_ID(); ?>"><?php the_title(); ?></a></li>
<?php
wp_reset_postdata();
endforeach; ?>
<?php
$link = get_post_type_archive_link('map');
if(function_exists('qtrans_convertURL'))
$link = qtrans_convertURL(get_post_type_archive_link('map'));
?>
<li><a href="<?php echo $link; ?>"><?php _e('View all maps', 'infoamazonia'); ?></a></li>
</ul>
</li>
<?php endif; ?>
</ul>
<?php if(!is_single()) : ?>
<div class="map-sidebar">
<div class="viewing-post">
</div>
<?php
if(is_home() && !is_paged() && !$_REQUEST['infoamazonia_filter_'])
get_template_part('section', 'sticky-posts');
?>
</div>
<?php endif; ?>
<div class="map-container">
<div id="mapgroup_<?php echo jeo_get_the_ID(); ?>_map" class="map">
</div>
</div>
</div>
</div>
<script type="text/javascript">
var group = jeo.group(<?php echo jeo_mapgroup_conf(); ?>);
</script>