HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: /home/mmickelson/jennysmasks.com/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 -->