/
sketch.php
68 lines (48 loc) · 1.36 KB
/
sketch.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
<?php
/*
Template Name: Sketch
*/
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="<?php stylesheet_url() ?>/components/acf-map/acf-map-style.css">
</head>
<body>
<?php
$args = array( 'post_type' => 'location');
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
?>
<li>
<div class="halo"><i class="mdi mdi-phone"></i> <?php the_phone() ?></div>
<p><i class="mdi mdi-email"></i> <?php the_email() ?></p>
<p><i class="mdi mdi-navigation"></i> <?php the_address() ?></p>
<?php
$google_map = get_field('google_map');
if( !empty($google_map) ):
?>
<br>
<?php echo $google_map['lat']; ?>
<br>
<?php echo $google_map['lng']; ?>
<br>
<div class="acf-map">
<div class="marker"
data-lat="<?php echo $google_map['lat']; ?>"
data-lng="<?php echo $google_map['lng']; ?>">
</div>
</div>
<?php
endif;
?>
</li>
<?php
endwhile;
?>
<foot>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script src="<?php stylesheet_url() ?>/components/acf-map/acf-map-script.js"></script>
</foot>
</body>
</html>