-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloop_images.php
More file actions
93 lines (76 loc) · 4.5 KB
/
Copy pathloop_images.php
File metadata and controls
93 lines (76 loc) · 4.5 KB
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
<?php
/**
* Loop main slider images
*
*
* Modified by cubicinfinity
*
* This file replaces `iconic-woothumbs/templates/loop-images.php`
*
* The purpose of this and the `loop-thumbnails.php` mod is to allow the shop image to be unique from the product page images.
*
* The featured product image will only appear in the woocommerce loop elements (shop pages, related products, etc.).
* Only gallery images will be used on the product page. (The featured image is skipped.)
*
* This change is not compatible with Woothumbs versions 4.11 and later because they deduplicate product images.
* However, after my complaints, Iconic to added a hook, `'iconic_woothumbs_dedupe_gallery_images'`,
* which will be of use getting this working in future versions of woothumbs.
* Consider `add_filter( 'iconic_woothumbs_dedupe_gallery_images', '__return_false' );`
*
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
global $post;
$product_settings = (array) get_post_meta( $post->ID, '_iconic_woothumbs', true );
$video_url = isset( $product_settings['video_url'] ) && $product_settings['video_url'] != "" ? $product_settings['video_url'] : false;
?>
<?php if ( ! empty( $images ) ) { ?>
<?php do_action( 'iconic_woothumbs_before_images_wrap' ); ?>
<div class="iconic-woothumbs-images-wrap">
<?php do_action( 'iconic_woothumbs_before_images' ); ?>
<div class="iconic-woothumbs-images <?php if ( $this->settings['fullscreen_general_click_anywhere'] && $this->settings['fullscreen_general_enable'] ) {
echo "iconic-woothumbs-images--click-anywhere";
} ?>">
<?php $i = 0; // BEGIN CHANGES HERE
foreach ( $images as $image ): ?>
<?php if ($i == 0) { $i ++; continue; } ?>
<div class="iconic-woothumbs-images__slide" <?php if ( $i > 1 ) {
echo 'style="display: none;"';
} ?> data-index="<?php echo $i - 1; ?>">
<?php do_action( 'iconic_woothumbs_image', $image, $i - 1, $images ); ?>
</div>
<?php $i ++; endforeach; // END CHANGES HERE ?>
</div>
<?php if ( $this->settings['fullscreen_general_enable'] ) { ?>
<a href="javascript: void(0);" style="display: none;" class="iconic-woothumbs-fullscreen" data-iconic-woothumbs-tooltip="<?php _e( 'Fullscreen', 'iconic-woothumbs' ); ?>"><i class="iconic-woothumbs-icon iconic-woothumbs-icon-fullscreen"></i></a>
<?php } ?>
<?php if ( $video_url ) { ?>
<a href="javascript: void(0);" class="iconic-woothumbs-play" data-iconic-woothumbs-tooltip="<?php _e( 'Play Video', 'iconic-woothumbs' ); ?>"><i class="iconic-woothumbs-icon iconic-woothumbs-icon-play"></i></a>
<?php } ?>
<div class="iconic-woothumbs-loading-overlay">
<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="40px" height="40px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
<path fill="<?php echo esc_attr( $this->settings['display_general_icon_colours'] ); ?>" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
<animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
</path>
</svg>
</div>
<?php do_action( 'iconic_woothumbs_after_images' ); ?>
</div>
<?php if ( $video_url ) { ?>
<div id="iconic-woothumbs-video-template" style="display: none;">
<div class="iconic-woothumbs-fullscreen-video-wrapper">
<?php echo Iconic_WooThumbs_Media::get_media_embed( $video_url ); ?>
<div class="iconic-woothumbs-loading-overlay">
<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="40px" height="40px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
<path fill="<?php echo esc_attr( $this->settings['display_general_icon_colours'] ); ?>" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
<animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
</path>
</svg>
</div>
</div>
</div>
<?php
}
do_action( 'iconic_woothumbs_after_images_wrap' );
}