Consulter le code

Add files via upload

Ivan FELICITE a écrit le 07/05/2018 00:00:24
Affichage de 1 fichier(s) changé(s)
1 1
new file mode 100644
... ...
@@ -0,0 +1,272 @@
0
+<?php
1
+/*
2
+* Single Portfolio Content
3
+*/
4
+
5
+ global $post, $virtue;
6
+?>
7
+<div id="pageheader" class="titleclass">
8
+		<div class="container">
9
+			<div class="page-header">
10
+				<div class="portfolionav clearfix">
11
+	   				<?php 
12
+	   				kadence_previous_post_link_plus( array('order_by' => 'menu_order', 'in_same_tax' => true, 'loop' => true, 'format' => '%link', 'link' => '<i class="icon-chevron-left"></i>') ); 
13
+	   			 	if( !empty($virtue['portfolio_link'])){ ?>
14
+						 <a href="<?php echo esc_url( get_page_link( $virtue[ 'portfolio_link' ] ) ); ?>">
15
+					<?php } else {?> 
16
+						<a href="../">
17
+					<?php } ?>
18
+	   				<i class="icon-th"></i></a> 
19
+	   				<?php kadence_next_post_link_plus( array('order_by' => 'menu_order', 'in_same_tax' => true, 'loop' => true, 'format' => '%link', 'link' => '<i class="icon-chevron-right"></i>') ); ?>
20
+	   				<span>&nbsp;</span>
21
+   				</div>
22
+			<h1 class="entry-title" itemprop="name headline"><?php the_title(); ?></h1>
23
+			</div>
24
+		</div><!--container-->
25
+</div><!--titleclass-->
26
+<?php do_action( 'kadence_single_portfolio_before' ); ?>
27
+<div id="content" class="container">
28
+    <div class="row">
29
+      <div class="main <?php echo esc_attr( virtue_main_class() ); ?> portfolio-single" role="main" itemscope itemtype="http://schema.org/CreativeWork">
30
+      <?php while (have_posts()) : the_post(); ?>
31
+      <?php 
32
+      	$layout 	= get_post_meta( $post->ID, '_kad_ppost_layout', true ); 
33
+		$ppost_type = get_post_meta( $post->ID, '_kad_ppost_type', true );
34
+		$imgheight 	= get_post_meta( $post->ID, '_kad_posthead_height', true );
35
+		$imgwidth 	= get_post_meta( $post->ID, '_kad_posthead_width', true );
36
+		$autoplay 	= get_post_meta( $post->ID, '_kad_portfolio_autoplay', true );
37
+		if( isset( $autoplay ) && $autoplay == 'no' ) {
38
+			$slideauto = 'false';
39
+		} else {
40
+			$slideauto = 'true';
41
+		}
42
+		if($layout == 'above')  {
43
+				$imgclass = 'col-md-12';
44
+				$textclass = 'pcfull clearfix';
45
+				$entryclass = 'col-md-8';
46
+				$valueclass = 'col-md-4';
47
+				$slidewidth_d = 1140;
48
+		} elseif ($layout == 'three')  {
49
+				$imgclass = 'col-md-12';
50
+				$textclass = 'pcfull clearfix';
51
+				$entryclass = 'col-md-12';
52
+				$valueclass = 'col-md-12';
53
+				$slidewidth_d = 1140;
54
+			} else {
55
+				$imgclass = 'col-md-7';
56
+				$textclass = 'col-md-5 pcside';
57
+				$entryclass = '';
58
+				$valueclass = '';
59
+				$slidewidth_d = 653;
60
+			 	}
61
+			 	$portfolio_margin = '';
62
+		if (!empty($imgheight)) {
63
+			$slideheight = $imgheight;
64
+		} else {
65
+			$slideheight = 450;
66
+		} 
67
+		if (!empty($imgwidth)) {
68
+			$slidewidth = $imgwidth;
69
+		} else {
70
+			$slidewidth = $slidewidth_d;
71
+		} 
72
+		 ?>
73
+  <article <?php post_class() ?> id="post-<?php the_ID(); ?>">
74
+      <div class="postclass">
75
+      	<div class="row">
76
+      		<div class="<?php echo esc_attr( $imgclass ); ?>">
77
+      		<?php do_action( 'kadence_single_portfolio_before_feature' );
78
+				
79
+				if ($ppost_type == 'flex') { ?>
80
+					<div class="flexslider loading kt-flexslider kad-light-gallery" style="max-width:<?php echo esc_attr( $slidewidth );?>px;" data-flex-speed="7000" data-flex-anim-speed="400" data-flex-animation="fade" data-flex-auto="<?php echo esc_attr($slideauto);?>">
81
+                       	<ul class="slides">
82
+						<?php
83
+                          	$image_gallery = get_post_meta( $post->ID, '_kad_image_gallery', true );
84
+                          		if(!empty($image_gallery)) {
85
+                    				$attachments = array_filter( explode( ',', $image_gallery ) );
86
+                    					if ($attachments) {
87
+											foreach ($attachments as $attachment) {
88
+												$img = virtue_get_image_array( $slidewidth, $slideheight, true, null, null, $attachment, false );
89
+												$caption = get_post($attachment)->post_excerpt;
90
+
91
+												echo '<li><a href="'.esc_url( $img[ 'full' ] ).'" data-rel="lightbox" title="'.esc_attr( $caption ).'" itemprop="image" itemscope itemtype="https://schema.org/ImageObject"><img src="'.esc_url( $img[ 'src' ] ).'" width="'.esc_attr( $img[ 'width' ] ).'" height="'.esc_attr( $img[ 'height' ] ).'" '.wp_kses_post( $img[ 'srcset' ] ).' alt="'.esc_attr( $img[ 'alt' ] ).'"/>';
92
+														echo '<meta itemprop="url" content="'.esc_url( $img['src'] ).'">';
93
+														echo '<meta itemprop="width" content="'.esc_attr( $img['width'] ).'">';
94
+														echo '<meta itemprop="height" content="'.esc_attr( $img['height'] ).'">';
95
+													echo '</a></li>';
96
+											}
97
+										}
98
+                    			} else {
99
+                    				$attach_args = array('order'=> 'ASC','post_type'=> 'attachment','post_parent'=> $post->ID,'post_mime_type' => 'image','post_status'=> null,'orderby'=> 'menu_order','numberposts'=> -1);
100
+									$attachments = get_posts($attach_args);
101
+										if ( $attachments ) {
102
+											foreach ( $attachments as $attachment ) {
103
+												$caption = get_post($attachment->ID)->post_excerpt;
104
+												$img = virtue_get_image_array( $slidewidth, $slideheight, true, null, null, $attachment->ID, false );
105
+												echo '<li><a href="'.esc_url( $img[ 'full' ] ).'" data-rel="lightbox" title="'.esc_attr( $caption ).'"><img src="'.esc_url( $img[ 'src' ] ).'" width="'.esc_attr( $img[ 'width' ] ).'" height="'.esc_attr( $img[ 'height' ] ).'" '.wp_kses_post( $img[ 'srcset' ] ).' alt="'.esc_attr( $img[ 'alt' ] ).'"/></a></li>';
106
+											}
107
+                    					}	
108
+								} ?>                                
109
+						</ul>
110
+              		</div> <!--Flex Slides-->
111
+              	<?php } else if ($ppost_type == 'carousel') { ?>
112
+					 <div id="imageslider" class="loading carousel_outerrim">
113
+					    <div class="carousel_slider_outer fredcarousel fadein-carousel" style="overflow:hidden; max-width:<?php echo esc_attr($slidewidth);?>px; height: <?php echo esc_attr($slideheight);?>px; margin-left: auto; margin-right:auto;">
114
+					        <div class="carousel_slider kad-light-gallery initcarouselslider" data-carousel-container=".carousel_slider_outer" data-carousel-transition="600" data-carousel-height="<?php echo esc_attr($slideheight); ?>" data-carousel-auto="<?php echo esc_attr( $slideauto );?>" data-carousel-speed="9000" data-carousel-id="carouselslider">
115
+					            <?php
116
+								$image_gallery = get_post_meta( $post->ID, '_kad_image_gallery', true );
117
+								if(!empty($image_gallery)) {
118
+									$attachments = array_filter( explode( ',', $image_gallery ) );
119
+									if ($attachments) {
120
+										foreach ( $attachments as $attachment ) {
121
+											$caption = get_post($attachment)->post_excerpt;
122
+											$img = virtue_get_image_array( null, $slideheight, false, null, null, $attachment, false );
123
+											echo '<div class="carousel_gallery_item" style="float:left; display: table; position: relative; text-align: center; margin: 0; width:auto; height:'.esc_attr( $img[ 'height' ] ).'px;">';
124
+												echo '<div class="carousel_gallery_item_inner" style="vertical-align: middle; display: table-cell;">';
125
+													echo '<a href="'.esc_url( $img[ 'full' ] ).'" data-rel="lightbox" title="'.esc_attr( $caption ).'" itemprop="image" itemscope itemtype="https://schema.org/ImageObject">';
126
+														echo '<img src="'.esc_url( $img[ 'src' ] ).'" width="'.esc_attr( $img[ 'width' ] ).'" height="'.esc_attr( $img[ 'height' ] ).'" '.wp_kses_post( $img[ 'srcset' ] ).'  />';
127
+														echo '<meta itemprop="url" content="'.esc_url( $img['src'] ).'">';
128
+														echo '<meta itemprop="width" content="'.esc_attr( $img['width'] ).'">';
129
+														echo '<meta itemprop="height" content="'.esc_attr( $img['height'] ).'">';
130
+													echo '</a>'; 
131
+												echo '</div>';
132
+											echo '</div>';
133
+										}
134
+									}
135
+								} ?>
136
+					            </div>
137
+					            <div class="clearfix"></div>
138
+					              <a id="prevport-carouselslider" class="prev_carousel icon-arrow-left" href="#"></a>
139
+					              <a id="nextport-carouselslider" class="next_carousel icon-arrow-right" href="#"></a>
140
+					          </div> <!--fredcarousel-->
141
+					  </div><!--carousel_outerrim-->
142
+				<?php 
143
+				} else if ($ppost_type == 'imagegrid') {
144
+						$image_gallery = get_post_meta( $post->ID, '_kad_image_gallery', true );
145
+						$columns = get_post_meta( $post->ID, '_kad_portfolio_img_grid_columns', true );
146
+        				if( empty( $columns ) ) { 
147
+        					$columns = '3';
148
+        				}
149
+						echo do_shortcode('[gallery ids="'.esc_attr( $image_gallery ).'" columns="'.esc_attr( $columns).'"]');
150
+				} else if ($ppost_type == 'video') { ?>
151
+					<div class="videofit">
152
+                  <?php
153
+					$allowed_tags = wp_kses_allowed_html('post');
154
+					$allowed_tags['iframe'] = array(
155
+						'src'             => true,
156
+						'height'          => true,
157
+						'width'           => true,
158
+						'frameborder'     => true,
159
+						'allowfullscreen' => true,
160
+						'name' 			  => true,
161
+						'id' 			  => true,
162
+						'class' 		  => true,
163
+						'style' 		  => true,
164
+					);
165
+
166
+					echo do_shortcode( wp_kses( get_post_meta( $post->ID, '_kad_post_video', true ), $allowed_tags ) );
167
+					if (has_post_thumbnail( $post->ID ) ) { 
168
+						$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>
169
+						<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
170
+							<meta itemprop="url" content="<?php echo esc_url( $image[0] ); ?>">
171
+							<meta itemprop="width" content="<?php echo esc_attr( $image[1] )?>">
172
+							<meta itemprop="height" content="<?php echo esc_attr( $image[2] )?>">
173
+						</div>
174
+					<?php }
175
+                  	?>
176
+                  </div>
177
+				<?php 
178
+				} else if ($ppost_type == 'none') {
179
+					 $portfolio_margin = "kad_portfolio_nomargin";
180
+				} else {
181
+					if ( has_post_thumbnail() ) {		
182
+						$image_id = get_post_thumbnail_id();
183
+						$img = virtue_get_image_array( $slidewidth, $slideheight, true, null, null, $image_id, false );
184
+						?>
185
+						<div class="imghoverclass">
186
+							<a href="<?php echo esc_url( $img[ 'full' ] ); ?>" data-rel="lightbox" class="lightboxhover" itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
187
+								<img src="<?php echo esc_url( $img[ 'src' ] ); ?>" width="<?php echo esc_attr( $img[ 'width' ] ); ?>" height="<?php echo esc_attr( $img[ 'height' ] ); ?>" <?php echo wp_kses_post( $img[ 'srcset' ] ); ?> alt="<?php echo esc_attr( get_post( $image_id )->post_excerpt ); ?>" />
188
+								<?php 
189
+								echo '<meta itemprop="url" content="'.esc_url( $img['src'] ).'">';
190
+								echo '<meta itemprop="width" content="'.esc_attr( $img['width'] ).'">';
191
+								echo '<meta itemprop="height" content="'.esc_attr( $img['height'] ).'">';
192
+								?>
193
+							</a>
194
+						</div>
195
+				<?php } 
196
+				}
197
+				do_action( 'kadence_single_portfolio_after_feature' ); ?>
198
+        </div><!--imgclass -->
199
+  		<div class="<?php echo esc_attr( $textclass ); ?>">
200
+		    <div class="entry-content <?php echo esc_attr( $entryclass ); ?> <?php echo esc_attr( $portfolio_margin ); ?>" itemprop="text">
201
+		    <?php 
202
+		      	do_action( 'kadence_single_portfolio_before_content' );
203
+					the_content(); 
204
+		      	do_action( 'kadence_single_portfolio_after_content' ); ?>
205
+		  	</div>
206
+		  	<?php  				
207
+			$project_v1t = get_post_meta( $post->ID, '_kad_project_val01_title', true );
208
+			$project_v1d = get_post_meta( $post->ID, '_kad_project_val01_description', true );
209
+			$project_v2t = get_post_meta( $post->ID, '_kad_project_val02_title', true );
210
+			$project_v2d = get_post_meta( $post->ID, '_kad_project_val02_description', true );
211
+			$project_v3t = get_post_meta( $post->ID, '_kad_project_val03_title', true );
212
+			$project_v3d = get_post_meta( $post->ID, '_kad_project_val03_description', true );
213
+			$project_v4t = get_post_meta( $post->ID, '_kad_project_val04_title', true );
214
+			$project_v4d = get_post_meta( $post->ID, '_kad_project_val04_description', true );
215
+			$project_v5t = get_post_meta( $post->ID, '_kad_project_val05_title', true );
216
+			$project_v5d = get_post_meta( $post->ID, '_kad_project_val05_description', true );
217
+		  	if( ! empty( $project_v1t ) || ! empty( $project_v2t ) || ! empty( $project_v3t ) || ! empty( $project_v4t ) || ! empty( $project_v5t ) ) { ?>
218
+	    		<div class="<?php echo esc_attr( $valueclass ); ?>">
219
+	    			<div class="pcbelow">
220
+	    			<?php do_action( 'kadence_single_portfolio_value_before' );  ?> 
221
+						<ul class="portfolio-content disc">
222
+						<?php 
223
+							if ( ! empty( $project_v1t ) ) {
224
+								echo '<li class="pdetails"><span>'.esc_html( $project_v1t ).'</span> '.esc_html( $project_v1d ).'</li>';
225
+							} 
226
+							if ( ! empty( $project_v2t ) ) {
227
+								echo '<li class="pdetails"><span>'.esc_html( $project_v2t ).'</span> '.esc_html( $project_v2d ).'</li>';
228
+							}
229
+							if ( ! empty( $project_v3t ) ) {
230
+								echo '<li class="pdetails"><span>'.esc_html( $project_v3t ).'</span> '.esc_html( $project_v3d ).'</li>';
231
+							}
232
+							if ( ! empty( $project_v4t ) ) {
233
+								echo '<li class="pdetails"><span>'.esc_html( $project_v4t ).'</span> '.esc_html( $project_v4d ).'</li>';
234
+							}
235
+							if ( ! empty( $project_v5t ) ) {
236
+								echo '<li class="pdetails"><span>'.esc_html( $project_v5t ).'</span> <a href="'.esc_url( $project_v5d ).'" target="_new">'.esc_html( $project_v5d ).'</a></li>';
237
+							}
238
+						?>
239
+				    	<?php do_action( 'kadence_single_portfolio_list_li' );  ?> 
240
+				    	</ul><!--Portfolio-content-->
241
+				    	<?php do_action( 'kadence_single_portfolio_value_after' );  ?> 
242
+					</div>
243
+				</div>
244
+			<?php } ?>
245
+    	</div><!--textclass -->
246
+    </div><!--row-->
247
+    <div class="clearfix"></div>
248
+    </div><!--postclass-->
249
+    <footer>
250
+     <?php
251
+      /**
252
+      * @hooked virtue_portfolio_nav - 10
253
+      */
254
+      do_action( 'kadence_single_portfolio_footer' ); 
255
+      ?>
256
+    </footer>
257
+  </article>
258
+<?php
259
+      /**
260
+      * @hooked virtue_portfolio_bottom_carousel - 30
261
+      * @hooked virtue_portfolio_comments - 40
262
+      */
263
+      do_action( 'kadence_single_portfolio_after' );
264
+
265
+      endwhile; ?>
266
+</div>
267
+<?php
268
+      /**
269
+      */
270
+      do_action( 'kadence_single_portfolio_end' );
271
+?>
0 272
\ No newline at end of file