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