/
page-visit.php
171 lines (133 loc) · 5.21 KB
/
page-visit.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
<?php
//Autore: Alex Vezzelli - Alex Soluzioni Web
//url: http://www.alexsoluzioniweb.it/
/**
*Template Name: Page Visit
*/
$path_img = esc_url( get_template_directory_uri() ).'/images/';
get_header(); ?>
<div class="fill nopadding">
<div clasS="col-xs-12 nopadding">
<?php
//Ottengo tutti i custom post type di Galleria Project
$args = array(
'post_type' => 'baa_gallerie',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'galleria_type',
'field' => 'slug',
'terms' => 'visit'
)
)
);
$fields = get_posts($args);
?>
<!-- Slider main container -->
<div class="swiper-container">
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
<!-- Slides -->
<?php
foreach($fields as $field){
printElement($field);
}
?>
</div>
<!-- If we need navigation buttons -->
<?php if(count($fields) > 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
$gallery = array();
$attachments = new Attachments( 'attachments', get_the_ID() );
if($attachments->exist()){
while($attachments->get()){
array_push($gallery, $attachments->src('full'));
}
}
//ottengo il contenuto
$content = "";
if ( have_posts() ) :
// Start the loop.
while ( have_posts() ) : the_post();
$content = get_the_content();
// End the loop.
endwhile;
endif;
//ottengo gli artisti
$pages = get_posts(array(
'post_type' => 'page',
'meta_key' => '_wp_page_template',
'meta_value' => 'page-artist.php'
));
$artists = array();
foreach($pages as $page){
$artist = array();
$artist['image'] = wp_get_attachment_url( get_post_thumbnail_id($page->ID));
$artist['page'] = $page->guid;
$artist['name'] = $page->post_title;
$artist['ruolo'] = get_post_meta($page->ID, 'ruolo', true);
array_push($artists, $artist);
}
?>
<div id="inside" class="visit">
<div class="background-logo"></div>
<div class="row">
<div class="col-xs-12 col-md-6">
<h2 class="red-1">B&A Gallery</h2>
<p><?php echo $content ?></p>
</div>
</div>
<!-- Slider main container -->
<div class="swiper-container">
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
<!-- Slides -->
<?php
for($i=0; $i < count($gallery); $i++){
printDirectElement($gallery[$i]);
}
?>
</div>
<!-- If we need navigation buttons -->
<?php if(count($gallery) > 1){ ?>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<?php } ?>
</div>
<div class="half-row" style="padding-top:10px">
<div class="col-xs-12 ">
<h2 class="red-2">Artist</h2>
<p><?php echo get_post_meta(get_the_ID(), 'artist', true); ?></p>
</div>
</div>
<div class="half-row black-container">
<div class="col-xs-12 contact col-dx">
<h2>Call for artist residence or present your portfolio </h2>
<div class="form-container">
<?php echo do_shortcode('[contact-form-7 id="68" title="support-form"]') ?>
</div>
</div>
</div>
<ul class="persone nopadding" style="clear:both; padding-top:10px">
<?php foreach($artists as $artist){ ?>
<li class="persona col-md-3 col-xs-6 nopadding">
<a href="<?php echo $artist['page'] ?>">
<div class="cover-image-persona">
<p>
<?php echo $artist['name'] ?><br><?php echo $artist['ruolo'] ?>
</p>
</div>
</a>
<img src="<?php echo $artist['image'] ?>" alt="<?php echo $artist['name'] ?>" style="width:100%" />
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
<?php get_footer(); ?>