HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: /volume1/web/wordpressIQva/wordressHua-tai/wp-content/themes/argent/content-portfolio-gallery.php
<?php
/**
 * Template used for displaying portfolio gallery in a carousel
 *
 * @package Argent
 */

$gallery = get_post_gallery( $post->ID, false ); // Get the first gallery
$images = explode( ',', $gallery['ids'] ); // Get the gallery image IDs
?>

	<div class="slick">
		<div class="slick-slider">

		<?php
		foreach( $images as $image ) :

			// Get the attachment's caption stored in post_excerpt
			$excerpt = get_post_field( 'post_excerpt', $image );

			// Only show a caption if there is one
			if ( ! empty( $excerpt ) ) {
				$image_excerpt_caption = '<div class="carousel-caption">'. $excerpt .'</div>';
			} else {
				$image_excerpt_caption = null;
			}

			// Output the image with captions
			$attachment = (array) wp_get_attachment_image_src( $image, 'full' );
			if ( isset( $attachment[0] ) ) {
			  echo '<div> ' . $image_excerpt_caption . ' <img src=" ' . esc_url( $attachment[0] ) . ' " /></div>';
			}

		endforeach;
		?>
		</div><!-- .slick-slider -->
	</div><!-- .slick -->