-
Notifications
You must be signed in to change notification settings - Fork 33
/
content-map-group.php
51 lines (51 loc) · 1.55 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
<?php
$mapgroup = jeo_get_mapgroup_data();
$main_maps = $more_maps = array();
// separate main maps from "more" 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">
<div class="map-nav-container">
<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...', 'jeo'); ?></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; ?>
<li><a href="<?php echo qtrans_convertURL(get_post_type_archive_link('map')); ?>"><?php _e('View all maps', 'jeo'); ?></a></li>
</ul>
</li>
<?php endif; ?>
</ul>
</div>
<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>