/
page-about.php
250 lines (200 loc) · 8.2 KB
/
page-about.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<?php
//Autore: Alex Vezzelli - Alex Soluzioni Web
//url: http://www.alexsoluzioniweb.it/
/**
*Template Name: Page About
*/
$path_img = esc_url( get_template_directory_uri() ).'/images/';
$pageID = get_the_ID();
get_header(); ?>
<div class="fill nopadding">
<div clasS="col-xs-12 nopadding">
<?php
//Ottengo tutti i custom post type di Galleria About
$args = array(
'post_type' => 'baa_gallerie',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'galleria_type',
'field' => 'slug',
'terms' => 'about'
)
)
);
$posts = get_posts($args);
?>
<!-- Slider main container -->
<div class="swiper-container">
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
<!-- Slides -->
<?php
foreach($posts as $post){
printElement($post);
}
?>
</div>
<!-- If we need navigation buttons -->
<?php if(count($posts) > 1){ ?>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<?php } ?>
</div>
<a href="#project-inside" class="discover-more">Discover</a>
<?php
//Ottengo i valori relativi ai campi di descrizione
// $args = array(
// 'post_type' => 'baa_abouts',
// 'posts_per_page' => -1,
// 'tax_query' => array(
// array(
// 'taxonomy' => 'about_type',
// 'field' => 'slug',
// 'terms' => 'campi-about'
// )
// )
// );
// $fields = get_posts($args);
$about_fields = array();
if(get_post_meta($pageID, 'about', true) != ''){
$about_fields['about'] = get_post_meta($pageID, 'about', true);
}
if(get_post_meta($pageID, 'where', true) != ''){
$about_fields['where'] = get_post_meta($pageID, 'where', true);
}
if(get_post_meta($pageID, 'title', true) != ''){
$about_fields['title'] = get_post_meta($pageID, 'title', true);
}
if(get_post_meta($pageID, 'subtitle', true) != ''){
$about_fields['subtitle'] = get_post_meta($pageID, 'subtitle', true);
}
//Ottengo i valori relativi alle persone
$args = array(
'post_type' => 'baa_abouts',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'about_type',
'field' => 'slug',
'terms' => 'persone'
)
)
);
$temps = get_posts($args);
$persone = array();
foreach($temps as $temp){
$persona = array();
$persona['nome'] = $temp->post_title;
$persona['ruolo'] = get_post_meta($temp->ID, 'ruolo', true);
$persona['image'] = wp_get_attachment_url( get_post_thumbnail_id($temp->ID));
array_push($persone, $persona);
}
$persone = array_reverse($persone);
?>
<div id="inside" class="about">
<div class="background-logo"></div>
<div class="row">
<div class="col-xs-12 col-md-6 col-md-push-6 col-dx">
<h2 class="red-1 title-page"><?php echo $about_fields['title'] ?></h2>
<p><?php echo $about_fields['subtitle'] ?></p>
</div>
<div class="col-xs-12 col-md-6 col-md-pull-6">
<h2 class="red-1">About</h2>
<p><?php echo $about_fields['about'] ?></p>
</div>
</div>
<ul class="persone nopadding">
<?php foreach($persone as $persona){ ?>
<li class="persona col-md-4 col-xs-6 nopadding">
<div class="cover-image-persona">
<p>
<?php echo $persona['nome'] ?><br><?php echo $persona['ruolo'] ?>
</p>
</div>
<img src="<?php echo $persona['image'] ?>" alt="<?php echo $persona['nome'] ?>" style="width:100%" />
</li>
<?php } ?>
</ul>
<div style="clear:both; display:block; width:100%"></div>
<div class="half-row">
<div class="col-xs-12 ">
<h2 class="red-2">Where</h2>
<p><?php echo $about_fields['where'] ?></p>
</div>
</div>
<div class="half-row black-container">
<div class="col-xs-12 contact col-dx">
<h2>Contact</h2>
<div class="form-container">
<?php echo do_shortcode('[contact-form-7 id="7" title="form-mail"]') ?>
</div>
</div>
</div>
<div class="col-xs-12 last-image nopadding clear">
<div id="map"></div>
</div>
<script>
// This example creates circles on the map, representing populations in North
// America.
// First, create an object containing LatLng and population for each city.
var citymap = {
venice: {
center: {lat: 45.4362676, lng: 12.3356981},
population: 2714856
}
};
var styles = [ {
stylers: [
{ saturation: "-100" }
]
},{
featureType: "road",
elementType: "labels",
stylers: [
{ visibility: "on" },
{ weight: 0.8 }
]
},{
featureType: "road.local",
elementType: "geometry",
stylers: [
{ hue: "#000" },
{ saturation: 80 }
]
}
];
function initMap() {
// Create the map.
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 15,
center: {lat: 45.4362676, lng: 12.3356981},
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl: true,
disableDefaultUI: false
});
var styledMap = new google.maps.StyledMapType(styles, {name: "Styled Map"});
// Construct the circle for each value in citymap.
// Note: We scale the area of the circle based on the population.
for (var city in citymap) {
// Add the circle for this city to the map.
var cityCircle = new google.maps.Circle({
strokeColor: '#FF0000',
strokeOpacity: 0.7,
strokeWeight: 1,
fillColor: '#FF0000',
fillOpacity: 0.35,
map: map,
center: citymap[city].center,
radius: Math.sqrt(citymap[city].population) * 0.2
});
}
map.mapTypes.set('map_style', styledMap);
map.setMapTypeId('map_style');
}
</script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCQonCTx6sZVRJAHTXws8Sf-Z9VeQm-NNA&callback=initMap"></script>
</div>
</div>
</div>
<?php get_footer(); ?>