Add Urlaub details in if block

This commit is contained in:
Markus Ankenbrand 2016-09-08 16:44:04 +02:00
parent 6aa207d3d6
commit 681dda2fc4

View file

@ -48,7 +48,8 @@
<div class="clear"></div> <div class="clear"></div>
<table> <?php if ( get_category() == 'urlaub' ) : ?>
<table>
<tr> <tr>
<th>Land</th> <th>Land</th>
<td><?php the_field( 'land' ) ?></td> <td><?php the_field( 'land' ) ?></td>
@ -65,17 +66,17 @@
<th>Abreise</th> <th>Abreise</th>
<td><?php $ab = get_field( 'abreise' ); echo(substr($ab,6,2).'.'.substr($ab,4,2).'.'.substr($ab,0,4)) ?></td> <td><?php $ab = get_field( 'abreise' ); echo(substr($ab,6,2).'.'.substr($ab,4,2).'.'.substr($ab,0,4)) ?></td>
</tr> </tr>
</table> </table>
<?php $location = get_field( 'ort' ); ?> <?php $location = get_field( 'ort' ); ?>
<h6>Location: <small><?php echo round( $location['lat'], 4 ) ?>, <?php echo round( $location['lng'], 4 ) ?></small></h6> <h6>Location: <small><?php echo round( $location['lat'], 4 ) ?>, <?php echo round( $location['lng'], 4 ) ?></small></h6>
<div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>'></div> <div class='map' style='height:300px; margin-bottom: 1.6842em' id='map-<?php echo $id ?>'></div>
<script type='text/javascript'> <script type='text/javascript'>
var map; var map;
var map_center = {lat: <?php echo $location['lat'] ?>, lng: <?php echo $location['lng'] ?> }; var map_center = {lat: <?php echo $location['lat'] ?>, lng: <?php echo $location['lng'] ?> };
function initMap() { function initMap() {
map = new google.maps.Map(document.getElementById('map-<?php echo $id ?>'), { map = new google.maps.Map(document.getElementById('map-<?php echo $id ?>'), {
center: map_center, center: map_center,
zoom: 15 zoom: 15
@ -84,8 +85,10 @@ function initMap() {
position: map_center, position: map_center,
map: map map: map
}); });
} }
</script> </script>
<?php endif; ?>
<?php <?php
$args = array( $args = array(
'before' => '<div class="page-links"><span class="title">' . __( 'Pages:','hitchcock' ) . '</span>', 'before' => '<div class="page-links"><span class="title">' . __( 'Pages:','hitchcock' ) . '</span>',