PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.5.13
Shortcodes and extra features for Phlox theme v2.5.13
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elements / gallery.php
auxin-elements / includes / elements Last commit date
about-widget.php 6 years ago accordion-widget.php 6 years ago accordion.php 6 years ago attachment-url.php 6 years ago audio.php 6 years ago before-after.php 6 years ago button.php 6 years ago code.php 6 years ago contact-box.php 6 years ago contact-form.php 6 years ago custom-list.php 6 years ago divider.php 6 years ago dropcap.php 6 years ago facebook.php 6 years ago flickr.php 6 years ago gallery.php 6 years ago general-element-fields.php 6 years ago gmap.php 6 years ago highlight.php 6 years ago image.php 6 years ago instagram-feed.php 6 years ago latest-items.php 8 years ago latest-posts-slider.php 6 years ago popular-posts-widget.php 6 years ago quote.php 6 years ago recent-posts-grid-carousel.php 6 years ago recent-posts-land-style.php 6 years ago recent-posts-masonry.php 6 years ago recent-posts-tiles-carousel.php 6 years ago recent-posts-tiles.php 6 years ago recent-posts-timeline.php 6 years ago recent-posts-widget.php 6 years ago recent-products.php 6 years ago related-posts.php 8 years ago sample-element.php 6 years ago search.php 6 years ago socials-list.php 6 years ago staff.php 6 years ago tab-widget.php 6 years ago tabs.php 6 years ago testimonial.php 6 years ago text.php 6 years ago touch-slider.php 6 years ago video.php 6 years ago
gallery.php
657 lines
1 <?php
2 /**
3 * Filterable gallery with lightbox
4 *
5 *
6 * @package Auxin
7 * @license LICENSE.txt
8 * @author averta
9 * @link http://phlox.pro/
10 * @copyright (c) 2010-2020 averta
11 */
12 function auxin_get_gallery_master_array( $master_array ) {
13
14 $master_array['aux_gallery'] = array(
15 'name' => __('Gallery', 'auxin-elements'),
16 'auxin_output_callback' => 'auxin_widget_gallery_callback',
17 'base' => 'aux_gallery',
18 'description' => __('Filterable and grid gallery with lightbox', 'auxin-elements'),
19 'class' => 'aux-widget-gallery',
20 'show_settings_on_create' => true,
21 'weight' => 1,
22 'is_widget' => false,
23 'is_shortcode' => true,
24 'is_so' => true,
25 'is_vc' => true,
26 'category' => THEME_NAME,
27 'group' => '',
28 'admin_enqueue_js' => '',
29 'admin_enqueue_css' => '',
30 'front_enqueue_js' => '',
31 'front_enqueue_css' => '',
32 'icon' => 'aux-element aux-pb-icons-gallery',
33 'custom_markup' => '',
34 'js_view' => '',
35 'html_template' => '',
36 'deprecated' => '',
37 'content_element' => '',
38 'as_parent' => '',
39 'as_child' => '',
40 'params' => array(
41 array(
42 'heading' => __('Title','auxin-elements'),
43 'description' => '',
44 'param_name' => 'title',
45 'type' => 'textfield',
46 'value' => '',
47 'holder' => 'textfield',
48 'class' => 'title',
49 'admin_label' => false,
50 'dependency' => '',
51 'weight' => '',
52 'group' => '' ,
53 'edit_field_class' => ''
54 ),
55 array(
56 'heading' => __('Images','auxin-elements'),
57 'description' => '',
58 'param_name' => 'include',
59 'type' => 'attach_images',
60 'value' => '',
61 'def_value' => '',
62 'holder' => '',
63 'class' => 'include',
64 'admin_label' => false,
65 'dependency' => '',
66 'weight' => '',
67 'group' => '' ,
68 'edit_field_class' => ''
69 ),
70 array(
71 'heading' => __('Gallery layout','auxin-elements'),
72 'description' => '',
73 'param_name' => 'layout',
74 'type' => 'aux_visual_select',
75 'def_value' => 'grid',
76 'choices' => array(
77 'grid' => array(
78 'label' => __('Grid', 'auxin-elements'),
79 'image' => AUXIN_URL . 'images/visual-select/gallery-grid.svg'
80 ),
81 'masonry' => array(
82 'label' => __('Masonry', 'auxin-elements'),
83 'image' => AUXIN_URL . 'images/visual-select/gallery-masonry.svg'
84 ),
85 'tiles' => array(
86 'label' => __('Tiles', 'auxin-elements'),
87 'image' => AUXIN_URL . 'images/visual-select/gallery-tile.svg'
88 ),
89 // 'justify-rows' => array(
90 // 'label' => __('Justify rows', 'auxin-elements'),
91 // 'image' => AUXIN_URL . 'images/visual-select/divider-diamond.svg'
92 // )
93 ),
94 'holder' => '',
95 'class' => 'layout',
96 'admin_label' => true,
97 'dependency' => '',
98 'weight' => '',
99 'group' => '' ,
100 'edit_field_class' => ''
101 ),
102 array(
103 'heading' => __( 'Post Tile styles','auxin-elements' ),
104 'description' => '',
105 'param_name' => 'tile_style_pattern',
106 'type' => 'aux_visual_select',
107 'def_value' => 'default',
108 'holder' => '',
109 'class' => 'tile_style_pattern',
110 'admin_label' => false,
111 'dependency' => array(
112 'element' => 'layout',
113 'value' => 'tiles'
114 ),
115 'weight' => '',
116 'group' => __( 'Style', 'auxin-elements' ),
117 'edit_field_class' => '',
118 'choices' => array(
119 'default' => array(
120 'label' => __( 'Default', 'auxin-elements' ),
121 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-5.svg'
122 ),
123 'pattern-1' => array(
124 'label' => __( 'Pattern 1', 'auxin-elements' ),
125 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-3.svg'
126 ),
127 'pattern-2' => array(
128 'label' => __( 'Pattern 2', 'auxin-elements' ),
129 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-6.svg'
130 ),
131 'pattern-3' => array(
132 'label' => __( 'Pattern 3', 'auxin-elements' ),
133 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-7.svg'
134 ),
135 'pattern-4' => array(
136 'label' => __( 'Pattern 4', 'auxin-elements' ),
137 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-8.svg'
138 ),
139 'pattern-5' => array(
140 'label' => __( 'Pattern 5', 'auxin-elements' ),
141 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-4.svg'
142 ),
143 'pattern-6' => array(
144 'label' => __('Pattern 6', 'auxin-elements' ),
145 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-1.svg'
146 ),
147 'pattern-7' => array(
148 'label' => __('Pattern 7', 'auxin-elements' ),
149 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-2.svg'
150 ),
151 )
152 ),
153 array(
154 'heading' => __('Order images by query','auxin-elements'),
155 'description' => '',
156 'param_name' => 'wp_order',
157 'type' => 'aux_switch',
158 'value' => '0',
159 'class' => '',
160 'admin_label' => false,
161 'dependency' => '',
162 'weight' => '',
163 'group' => '' ,
164 'edit_field_class' => ''
165 ),
166 array(
167 'heading' => __('Order','auxin-elements'),
168 'description' => __('Order images ascending or descending','auxin-elements'),
169 'param_name' => 'order',
170 'type' => 'dropdown',
171 'def_value' => 'ASC',
172 'value' => array(
173 'ASC' => __('ASC' , 'auxin-elements'),
174 'DESC' => __('DESC', 'auxin-elements')
175 ),
176 'holder' => '',
177 'class' => 'order',
178 'admin_label' => false,
179 'dependency' => array(
180 'element' => 'wp_order',
181 'value' => '1'
182 ),
183 'weight' => '',
184 'group' => '' ,
185 'edit_field_class' => ''
186 ),
187 array(
188 'heading' => __('Order images by','auxin-elements'),
189 'description' => '',
190 'param_name' => 'orderby',
191 'type' => 'dropdown',
192 'def_value' => 'menu_order ID',
193 'value' => array(
194 'menu_order ID' => __('Menu Order' , 'auxin-elements'),
195 'date' => __('Date' , 'auxin-elements'),
196 'ID' => __('ID' , 'auxin-elements'),
197 'none' => __('None' , 'auxin-elements')
198 ),
199 'dependency' => array(
200 'element' => 'wp_order',
201 'value' => '1'
202 ),
203 'holder' => '',
204 'class' => 'orderby',
205 'admin_label' => false,
206 'weight' => '',
207 'group' => '' ,
208 'edit_field_class' => ''
209 ),
210 array(
211 'heading' => __('Number of columns', 'auxin-elements'),
212 'description' => '',
213 'param_name' => 'columns',
214 'type' => 'dropdown',
215 'def_value' => '4',
216 'holder' => '',
217 'class' => 'columns',
218 'value' => array(
219 '1' => '1', '2' => '2', '3' => '3',
220 '4' => '4', '5' => '5', '6' => '6'
221 ),
222 'admin_label' => false,
223 'dependency' => array(
224 'element' => 'layout',
225 'value' => array( 'grid', 'masonry' )
226 ),
227 'weight' => '',
228 'group' => __( 'Layout', 'auxin-elements' ),
229 'edit_field_class' => ''
230 ),
231 array(
232 'heading' => __('Number of columns in tablet size', 'auxin-elements'),
233 'description' => '',
234 'param_name' => 'tablet_cnum',
235 'type' => 'dropdown',
236 'def_value' => 'inherit',
237 'holder' => '',
238 'class' => 'tablet_cnum',
239 'value' => array(
240 'inherit' => 'Inherited from larger',
241 '1' => '1', '2' => '2', '3' => '3',
242 '4' => '4', '5' => '5', '6' => '6'
243 ),
244 'admin_label' => false,
245 'dependency' => array(
246 'element' => 'layout',
247 'value' => array( 'grid', 'masonry' )
248 ),
249 'weight' => '',
250 'group' => __( 'Layout', 'auxin-elements' ),
251 'edit_field_class' => ''
252 ),
253 array(
254 'heading' => __('Number of columns in phone size', 'auxin-elements'),
255 'description' => '',
256 'param_name' => 'phone_cnum',
257 'type' => 'dropdown',
258 'def_value' => '1',
259 'holder' => '',
260 'class' => 'phone_cnum',
261 'value' => array(
262 '1' => '1' , '2' => '2', '3' => '3'
263 ),
264 'admin_label' => false,
265 'dependency' => array(
266 'element' => 'layout',
267 'value' => array( 'grid', 'masonry' )
268 ),
269 'weight' => '',
270 'group' => __( 'Layout', 'auxin-elements' ),
271 'edit_field_class' => ''
272 ),
273 array(
274 'heading' => __('Space','auxin-elements'),
275 'description' => __('Space between gallery items in pixel.', 'auxin-elements'),
276 'param_name' => 'space',
277 'type' => 'textfield',
278 'value' => '10',
279 'def_value' => '',
280 'holder' => '',
281 'class' => 'space',
282 'admin_label' => false,
283 'dependency' => array(
284 'element' => 'layout',
285 'value' => array( 'grid', 'masonry' )
286 ),
287 'weight' => '',
288 'group' => '' ,
289 'edit_field_class' => ''
290 ),
291 array(
292 'heading' => __('Image aspect ratio', 'auxin-elements'),
293 'description' => '',
294 'param_name' => 'image_aspect_ratio',
295 'type' => 'dropdown',
296 'def_value' => '0.75',
297 'holder' => '',
298 'class' => 'order',
299 'value' =>array (
300 '0.75' => __('Horizontal 4:3' , 'auxin-elements'),
301 '0.56' => __('Horizontal 16:9', 'auxin-elements'),
302 '1.00' => __('Square 1:1' , 'auxin-elements'),
303 '1.33' => __('Vertical 3:4' , 'auxin-elements')
304 ),
305 'admin_label' => false,
306 'dependency' => array(
307 'element' => 'layout',
308 'value' => array( 'grid' )
309 ),
310 'weight' => '',
311 'group' => '' ,
312 'edit_field_class' => ''
313 ),
314 array(
315 'heading' => __('Link images to','auxin-elements'),
316 'description' => '',
317 'param_name' => 'link',
318 'type' => 'dropdown',
319 'def_value' => 'lightbox',
320 'value' => array(
321 'lightbox' => __('Lightbox', 'auxin-elements'),
322 'none' => __('None' , 'auxin-elements'),
323 '' => __('Attachment Page' , 'auxin-elements'),
324 'file' => __('File' , 'auxin-elements')
325 ),
326 'holder' => '',
327 'class' => 'link',
328 'admin_label' => false,
329 'dependency' => '',
330 'weight' => '',
331 'group' => '' ,
332 'edit_field_class' => ''
333 ),
334 array(
335 'heading' => __('Enable pagination','auxin-elements'),
336 'description' => '',
337 'param_name' => 'pagination',
338 'type' => 'aux_switch',
339 'value' => '0',
340 'class' => '',
341 'admin_label' => false,
342 'dependency' => '',
343 'weight' => '',
344 'group' => '' ,
345 'edit_field_class' => ''
346 ),
347 array(
348 'heading' => __('Enable lazyload','auxin-elements'),
349 'description' => __('Only load images that are in visible page','auxin-elements'),
350 'param_name' => 'lazyload',
351 'type' => 'aux_switch',
352 'value' => '0',
353 'class' => '',
354 'admin_label' => false,
355 'dependency' => array(
356 'element' => 'pagination',
357 'value' => '1'
358 ),
359 'weight' => '',
360 'group' => '' ,
361 'edit_field_class' => ''
362 ),
363 array(
364 'heading' => __('Images per page','auxin-elements'),
365 'description' => '',
366 'param_name' => 'perpage',
367 'type' => 'textfield',
368 'value' => '24',
369 'def_value' => '',
370 'holder' => '',
371 'class' => 'id',
372 'admin_label' => false,
373 'dependency' => array(
374 'element' => 'pagination',
375 'value' => '1'
376 ),
377 'weight' => '',
378 'group' => '' ,
379 'edit_field_class' => ''
380 ),
381 array(
382 'heading' => __('Extra class name','auxin-elements'),
383 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'auxin-elements'),
384 'param_name' => 'extra_classes',
385 'type' => 'textfield',
386 'value' => '',
387 'def_value' => '',
388 'holder' => '',
389 'class' => 'extra_classes',
390 'admin_label' => false,
391 'dependency' => '',
392 'weight' => '',
393 'group' => '' ,
394 'edit_field_class' => ''
395 )
396 )
397 );
398
399 return $master_array;
400 }
401
402 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_gallery_master_array', 10, 1 );
403
404 // This is the widget call back in fact the front end out put of this widget comes from this function
405 function auxin_widget_gallery_callback( $attr, $shortcode_content = null ){
406 if ( ! empty( $attr['ids'] ) ) {
407 $attr['include'] = $attr['ids'];
408 }
409
410 static $instance = 0;
411 $instance++;
412 $selector = "aux-gallery-{$instance}";
413
414 global $post;
415
416 // Defining default attributes
417 $default_atts = array(
418 'order' => 'ASC',
419 'orderby' => 'menu_order ID',
420 'id' => $post ? $post->ID : 0,
421 'columns' => 4,
422 'tablet_cnum' => 'inherit',
423 'phone_cnum' => 1,
424 'space' => 10,
425 'image_aspect_ratio' => 0.75,
426 'default_image_size' => 'medium', // empty, 'thumbnail', 'medium', 'medium_large', 'large'. default image size for grid image size
427 'layout' => 'grid', // grid, masonry, justify-rows, packery
428 'include' => '',
429 'tile_style_pattern' => 'default',
430 'link' => 'lightbox', // none, file, empty(attachment), lightbox
431 'perpage' => 24,
432 'pagination' => false,
433 'lazyload' => false,
434 'wp_order' => false,
435 'title' => '', // header title
436 'extra_classes' => '', // custom css class names for this element
437 'custom_el_id' => '', // custom id attribute for this element
438 'base_class' => 'aux-widget-gallery' // base class name for container
439 );
440
441 $result = auxin_get_widget_scafold( $attr, $default_atts );
442 extract( $result['parsed_atts'] );
443
444 // ------------------------------------------
445
446 if ( ! auxin_is_true( $wp_order ) && empty( $ids ) ) {
447 $order = 'ASC';
448 $orderby = 'post__in';
449 }
450
451 // sanitize the boolean options
452 $pagination = auxin_is_true( $pagination );
453 $lazyload = auxin_is_true( $lazyload );
454
455 $attachments = array();
456
457 if ( ! empty( $include ) ) {
458 $_attachments = get_posts(
459 array(
460 'include' => $include,
461 'post_status' => 'inherit',
462 'post_type' => 'attachment',
463 'post_mime_type' => 'image',
464 'order' => $order,
465 'orderby' => $orderby
466 )
467 );
468
469 foreach ( $_attachments as $key => $val ) {
470 $attachments[$val->ID] = $_attachments[$key];
471 }
472 }
473
474 if ( empty( $attachments ) ) {
475 return '';
476 }
477
478 if ( is_feed() ) {
479 $output = "\n";
480 foreach ( $attachments as $att_id => $attachment ) {
481 $output .= wp_get_attachment_link( $att_id, 'medium', true ) . "\n";
482 }
483 return $output;
484 }
485
486 ob_start();
487
488 // widget header ------------------------------
489 echo $result['widget_header'];
490 echo $result['widget_title'];
491
492 $crop = false;
493
494 if ( 'grid' == $layout ) {
495 $crop = true;
496 }
497
498 if ( empty( $layout ) || 'grid' == $layout ){
499 $isotop_layout = 'masonry';
500 } elseif ( 'justify-rows' == $layout ) {
501 $isotop_layout = 'justifyRows';
502 } elseif ( 'tiles' == $layout ) {
503 $isotop_layout = 'packery';
504 $space = 0;
505 } else {
506 $isotop_layout = 'masonry';
507 }
508
509 $add_lightbox = ( $link == 'lightbox' );
510 $add_caption = false;
511
512 echo "<div id='$selector' class='aux-gallery galleryid-{$id} gallery-columns-{$columns} " . ( $add_lightbox ? 'aux-lightbox-gallery' : '' ) . "'>";
513
514 // isotope attributes
515 $isotope_attrs = ' data-pagination="' . ( $pagination ? 'true' : 'false' ) . '"'.
516 ' data-lazyload="' . ( $lazyload ? 'true' : 'false' ) . '"'.
517 ' data-perpage="' . esc_attr( $perpage) . '"'.
518 ' data-layout="' . esc_attr( $isotop_layout ) . '"'.
519 ' data-space="' . esc_attr( $space ) . '"';
520
521 if ( 'tiles' == $layout ) {
522 $column_class = 'aux-tiles-layout';
523 $column_media_width = $content_width;
524 $isotope_item_classes = 'aux-iso-item';
525 } else {
526 $column_class = 'aux-row aux-de-col' . $columns;
527 if ( 'inherit' == $tablet_cnum ) {
528 $tablet_cnum = $columns;
529 }
530
531 $column_class .= ' aux-tb-col'. $tablet_cnum;
532 $column_class .= ' aux-mb-col'. $phone_cnum;
533 // Make the element clickable while editing in elementor
534 $column_class .= ' elementor-clickable';
535
536 $column_media_width = auxin_get_content_column_width( $columns, $space, $content_width );
537 $isotope_item_classes = 'aux-iso-item aux-col';
538 }
539
540 $column_media_width = round( $column_media_width );
541
542 printf( '<div class="aux-gallery-container aux-isotope-animated %s aux-no-gutter aux-layout-%s" %s >', esc_attr( $column_class ), esc_attr( $isotop_layout ), $isotope_attrs );
543
544
545 if ( $lazyload ) {
546 $isotope_item_classes .= ' aux-loading';
547
548 ?>
549 <div class="aux-items-loading">
550 <div class="aux-loading-loop">
551 <svg class="aux-circle" width="100%" height="100%" viewBox="0 0 42 42">
552 <circle class="aux-stroke-bg" r="20" cx="21" cy="21" fill="none"></circle>
553 <circle class="aux-progress" r="20" cx="21" cy="21" fill="none" transform="rotate(-90 21 21)"></circle>
554 </svg>
555 </div>
556 </div>
557 <?php
558 }
559
560 $index = 0;
561
562 foreach ( $attachments as $id => $attachment ) {
563
564 $isotope_item_attrs = '';
565 $attachment_meta = wp_get_attachment_metadata( $id );
566
567 if ( $add_lightbox || 'file' == $link ) {
568 $attachment_url = auxin_get_attachment_url( $id, 'full' );
569 } elseif ( 'attachment' == $link ) {
570 $attachment_url = get_attachment_link( $id );
571 } elseif( 'none' == $link ) {
572 $attachment_url = '#null';
573 $link = 'null';
574 }
575
576 $lightbox_attrs = 'data-elementor-open-lightbox="no" ';
577
578 if ( $add_lightbox ) {
579 $lightbox_attrs .= 'data-original-width="' . esc_attr( $attachment_meta['width'] ) . '" data-original-height="' . esc_attr( $attachment_meta['height'] ) . '" ' .
580 'data-caption="' . esc_attr( strip_tags( auxin_attachment_caption( $id ) ) ) . '"';
581 }
582
583 if ( 'tiles' == $layout ) {
584 $item_pattern_info = auxin_get_tile_pattern( $tile_style_pattern , $index, $column_media_width );
585 $attachment_media = auxin_get_the_responsive_attachment(
586 $id,
587 array(
588 'preloadable' => $lazyload ? null: false,
589 'crop' => true,
590 'add_hw' => true, // whether add width and height attr or not
591 'upscale' => true,
592 'size' => $item_pattern_info['size'],
593 'image_sizes' => 'auto',
594 'srcset_sizes' => 'auto'
595 )
596
597 );
598
599 } else {
600 if ( 'masonry' == $layout ){
601 $image_aspect_ratio = 0;
602
603 $the_sizes = array(
604 array( 'width' => $column_media_width, 'height' => $column_media_width * $image_aspect_ratio ),
605 array( 'width' => 2 * $column_media_width, 'height' => 2 * $column_media_width * $image_aspect_ratio ),
606 array( 'width' => 4 * $column_media_width, 'height' => 4 * $column_media_width * $image_aspect_ratio )
607 );
608
609 } else {
610 $the_sizes = 'auto';
611 }
612
613 $image_dimension = empty( $default_image_size ) ? array( 'width' => $column_media_width, 'height' => $column_media_width * $image_aspect_ratio ) : $default_image_size;
614
615 $attachment_media = auxin_get_the_responsive_attachment(
616 $id,
617 array(
618 'preloadable' => null,
619 'preload_preview' => false,
620 'crop' => $crop,
621 'size' => $image_dimension,
622 'add_hw' => true, // whether add width and height attr or not
623 'upscale' => true,
624 'image_sizes' => array(
625 array( 'min' => '', 'max' => '767px', 'width' => round( 100 / $phone_cnum ).'vw' ),
626 array( 'min' => '768px', 'max' => '992px', 'width' => round( 100 / $tablet_cnum ).'vw' ),
627 array( 'min' => '' , 'max' => '', 'width' => $column_media_width.'px' )
628 ),
629 'srcset_sizes' => $the_sizes
630 )
631 );
632 }
633
634 $index ++;
635 if ( auxin_is_true( $pagination ) && $index > $perpage ) {
636 $item_classes = 'aux-iso-hidden';
637 } else {
638 $item_classes = '';
639 }
640
641 if ( 'tiles' == $layout ) {
642 $item_classes .= ' aux-image-box '. esc_attr( $item_pattern_info['classname'] );
643 }
644
645 include( locate_template( 'templates/theme-parts/entry/gallery-image.php' ) );
646 }
647
648 echo "</div></div>";
649
650 // widget footer ------------------------------
651 echo $result['widget_footer'];
652
653 printf( '<style>.aux-parent-%s .aux-frame-ratio { padding-bottom:%s }</style>', $universal_id, round( $image_aspect_ratio * 100 ) . '%' );
654
655 return ob_get_clean();
656 }
657