-
Notifications
You must be signed in to change notification settings - Fork 1
/
page-restaurants.php
89 lines (86 loc) · 3.33 KB
/
page-restaurants.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
/**
* The template for displaying all pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site may use a
* different template.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Clogged_Arteries
*/
get_header();
?>
<main id="primary" class="site-main restaurant-page">
<?php
while(have_posts()):
the_post();
$args = array(
'post_type' => 'cla-restaurant',
'posts_per_page' => -1,
);
$query = new WP_Query($args);
if ($query->have_posts()) :
while ($query->have_posts()) :
$query->the_post();
echo '<article class="info-map">';
echo '<div class="restaurant-card">';
$pinpoint = get_field('pinpoint_image');
$ig = get_field('instagram_logo');
if (function_exists('get_field')) :
if (get_field('pinpoint_image')) :
echo wp_get_attachment_image($pinpoint, 'large');
endif;
echo '<h2>';
the_title();
echo '</h2>';
if (get_field('address')) :
echo '<p>';
the_field('address');
echo '</p>';
endif;
if (get_field('phone_number')) :
echo '<p>';
the_field('phone_number');
echo '</p>';
endif;
if (get_field('hours')) :
echo '<p>';
the_field('hours');
echo '</p>';
endif;
if (get_field('instagram_logo') AND get_field('instagram_link')) :
?>
<a href="<?php the_field('instagram_link')?>">
<?php
echo wp_get_attachment_image($ig, 'large');
?>
</a>
<?php
endif;
echo "</div>";
?>
<div class = 'acf-map'>
<?php
if (get_field('map')) :
$map = get_field('map')
?>
<div class = "marker" data-lat="<?php echo $map['lat']?>" data-lng="<?php echo $map['lng']?>">
</div>
<?php
endif;
?>
</div>
<?php
echo '</article>';
endif;
endwhile;
wp_reset_postdata();
endif;
endwhile;
?>
</main><!-- #main -->
<?php
get_footer();