Fix case with ort but no orte
This commit is contained in:
parent
d6abc8d5a5
commit
8cfcc32212
1 changed files with 5 additions and 19 deletions
24
single.php
24
single.php
|
|
@ -75,25 +75,11 @@
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php $location = get_field( 'ort' ); ?>
|
<?php $location = get_field( 'ort' ); ?>
|
||||||
<?php $locations = get_field( 'orte' ); ?>
|
<?php $locations = get_field( 'orte' ); ?>
|
||||||
<?php if ( $location && (!$locations || count($locations)==0 || is_nan($locations[0]['lat'])) ) : ?>
|
<?php
|
||||||
<div class="post-meta">
|
if ( $location && !$locations ) :
|
||||||
<div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>-single'></div>
|
$locations = [$location];
|
||||||
<script type='text/javascript'>
|
endif;
|
||||||
var single_map;
|
?>
|
||||||
var single_map_center = {lat: <?php echo $location['lat'] ?>, lng: <?php echo $location['lng'] ?> };
|
|
||||||
function initMap() {
|
|
||||||
map = new google.maps.Map(document.getElementById('map-<?php echo $id ?>-single'), {
|
|
||||||
center: single_map_center,
|
|
||||||
zoom: 15
|
|
||||||
});
|
|
||||||
var marker = new google.maps.Marker({
|
|
||||||
position: single_map_center,
|
|
||||||
map: single_map
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ( $locations && count($locations)>0 && !is_nan($locations[0]['lat'])) : ?>
|
<?php if ( $locations && count($locations)>0 && !is_nan($locations[0]['lat'])) : ?>
|
||||||
<div class="post-meta">
|
<div class="post-meta">
|
||||||
<div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>-multiple'></div>
|
<div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>-multiple'></div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue