HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/html/ielts-store/wp-content/themes/oceanwp/woocommerce/loop/thumbnail/gallery-slider.php
<?php
/**
 * Gallery Style WooCommerce
 *
 * @package OceanWP WordPress theme
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

// Return dummy image if no featured image is defined.
if ( ! has_post_thumbnail() ) {
	oceanwp_woo_placeholder_img();
	return;
}

// Get global product data.
global $product;

// Get featured image.
$thumbnail_id = $product->get_image_id();

// Get gallery images.
if ( version_compare( OceanWP_WooCommerce_Config::get_wc_version(), '2.7', '>=' ) ) {
	$attachment_ids = $product->get_gallery_image_ids();
} else {
	$attachment_ids = $product->get_gallery_attachment_ids();
}

// Get attachments count.
$attachments_count = count( $attachment_ids );

// Image args.
$img_args = array(
	'alt' => get_the_title(),
);
if ( oceanwp_get_schema_markup( 'image' ) ) {
	$img_args['itemprop'] = 'image';
}

// If there are attachments display slider.
if ( $attachment_ids ) : ?>

	<div class="product-entry-slider-wrap">

		<?php do_action( 'ocean_before_product_entry_slider' ); ?>

		<div class="product-entry-slider woo-entry-image clr">

			<?php do_action( 'ocean_before_product_entry_image' ); ?>

			<?php
			// Define counter variable.
			$count = 0;

			if ( has_post_thumbnail() ) :
				?>

				<div class="oceanwp-slider-slide">
					<a href="<?php the_permalink(); ?>" class="woocommerce-LoopProduct-link">
						<?php
						echo wp_get_attachment_image( $thumbnail_id, 'shop_catalog', '', $img_args );
						?>
					</a>
				</div>

				<?php
			endif;

			if ( $attachments_count > 0 ) :

				// Loop through images.
				foreach ( $attachment_ids as $attachment_id ) :

					// Add to counter.
					$count++;

					// Only display the first 5 images.
					if ( $count < 5 ) :
						?>

						<div class="oceanwp-slider-slide">
							<a href="<?php the_permalink(); ?>" class="woocommerce-LoopProduct-link">
								<?php
								echo wp_get_attachment_image( $attachment_id, 'shop_catalog', '', $img_args );
								?>
							</a>
						</div>

						<?php
					endif;

				endforeach;

			endif;
			?>

			<?php do_action( 'ocean_after_product_entry_image' ); ?>

		</div>

		<?php do_action( 'ocean_after_product_entry_slider' ); ?>

	</div>

	<?php
	// There aren't any images so lets display the featured image.
else :

	wc_get_template( 'loop/thumbnail/featured-image.php' );

endif;
?>