PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.9.17
Shortcodes and extra features for Phlox theme v2.9.17
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 / recent-posts-masonry.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 4 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
recent-posts-masonry.php
677 lines
1 <?php
2 /**
3 * Code highlighter element
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
13 function auxin_get_recent_posts_masonry_master_array( $master_array ) {
14
15 $categories = get_terms( 'category', 'orderby=count&hide_empty=0' );
16 $categories_list = array( ' ' => __('All Categories', 'auxin-elements' ) ) ;
17 foreach ( $categories as $key => $value ) {
18 $categories_list[$value->term_id] = $value->name;
19 }
20
21 // $tags = get_terms( 'post_tag', 'orderby=count&hide_empty=0' );
22 // $tags_list;
23 // foreach ($tags as $key => $value) {
24 // $tags_list["$value->term_id"] = $value->name;
25 // }
26
27
28 $master_array['aux_recent_posts_masonry'] = array(
29 'name' => __('Masonry Recent Posts', 'auxin-elements' ),
30 'auxin_output_callback' => 'auxin_widget_recent_posts_masonry_callback',
31 'base' => 'aux_recent_posts_masonry',
32 'description' => __('It adds recent posts in masonry style.', 'auxin-elements' ),
33 'class' => 'aux-widget-recent-posts-masonry aux-column-post-entry',
34 'show_settings_on_create' => true,
35 'weight' => 1,
36 'is_widget' => false,
37 'is_shortcode' => true,
38 'is_vc' => true,
39 'category' => THEME_NAME,
40 'group' => '',
41 'admin_enqueue_js' => '',
42 'admin_enqueue_css' => '',
43 'front_enqueue_js' => '',
44 'front_enqueue_css' => '',
45 'icon' => 'aux-element aux-pb-icons-masonry',
46 'custom_markup' => '',
47 'js_view' => '',
48 'html_template' => '',
49 'deprecated' => '',
50 'content_element' => '',
51 'as_parent' => '',
52 'as_child' => '',
53 'params' => array(
54 array(
55 'heading' => __('Title','auxin-elements' ),
56 'description' => __('Recent post title, leave it empty if you don`t need title.', 'auxin-elements'),
57 'param_name' => 'title',
58 'type' => 'textfield',
59 'std' => '',
60 'value' => '',
61 'holder' => 'textfield',
62 'class' => 'title',
63 'admin_label' => false,
64 'dependency' => '',
65 'weight' => '',
66 'group' => '',
67 'edit_field_class' => ''
68 ),
69 array(
70 'heading' => __('Categories', 'auxin-elements'),
71 'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
72 'param_name' => 'cat',
73 'type' => 'aux_select2_multiple',
74 'def_value' => ' ',
75 'holder' => '',
76 'class' => 'cat',
77 'value' => $categories_list,
78 'admin_label' => false,
79 'dependency' => '',
80 'weight' => '',
81 'group' => __( 'Query', 'auxin-elements' ),
82 'edit_field_class' => ''
83 ),
84 array(
85 'heading' => __('Number of posts to show', 'auxin-elements'),
86 'description' => '',
87 'param_name' => 'num',
88 'type' => 'textfield',
89 'value' => '8',
90 'holder' => '',
91 'class' => 'num',
92 'admin_label' => false,
93 'dependency' => '',
94 'weight' => '',
95 'group' => __( 'Query', 'auxin-elements' ),
96 'edit_field_class' => ''
97 ),
98 array(
99 'heading' => __('Exclude posts without media','auxin-elements' ),
100 'description' => '',
101 'param_name' => 'exclude_without_media',
102 'type' => 'aux_switch',
103 'value' => '0',
104 'class' => '',
105 'admin_label' => false,
106 'dependency' => '',
107 'weight' => '',
108 'group' => __( 'Query', 'auxin-elements' ),
109 'edit_field_class' => ''
110 ),
111 array(
112 'heading' => __('Exclude custom post formats','auxin-elements' ),
113 'description' => '',
114 'param_name' => 'exclude_custom_post_formats',
115 'type' => 'aux_switch',
116 'value' => '0',
117 'class' => '',
118 'admin_label' => false,
119 'dependency' => '',
120 'weight' => '',
121 'group' => __( 'Query', 'auxin-elements' ),
122 'edit_field_class' => ''
123 ),
124 array(
125 'heading' => __('Exclude quote and link post formats','auxin-elements' ),
126 'description' => '',
127 'param_name' => 'exclude_quote_link',
128 'type' => 'aux_switch',
129 'value' => '0',
130 'class' => '',
131 'admin_label' => false,
132 'dependency' => array(
133 'element' => 'exclude_custom_post_formats',
134 'value' => array('0', 'false')
135 ),
136 'weight' => '',
137 'group' => '',
138 'edit_field_class' => ''
139 ),
140 array(
141 'heading' => __('Order by', 'auxin-elements'),
142 'description' => '',
143 'param_name' => 'order_by',
144 'type' => 'dropdown',
145 'def_value' => 'date',
146 'holder' => '',
147 'class' => 'order_by',
148 'value' => array (
149 'date' => __('Date', 'auxin-elements'),
150 'menu_order date' => __('Menu Order', 'auxin-elements'),
151 'title' => __('Title', 'auxin-elements'),
152 'ID' => __('ID', 'auxin-elements'),
153 'rand' => __('Random', 'auxin-elements'),
154 'comment_count' => __('Comments', 'auxin-elements'),
155 'modified' => __('Date Modified', 'auxin-elements'),
156 'author' => __('Author', 'auxin-elements'),
157 'post__in' => __('Inserted Post IDs', 'auxin-elements')
158 ),
159 'admin_label' => false,
160 'dependency' => '',
161 'weight' => '',
162 'group' => __( 'Query', 'auxin-elements' ),
163 'edit_field_class' => ''
164 ),
165 array(
166 'heading' => __('Order', 'auxin-elements'),
167 'description' => '',
168 'param_name' => 'order',
169 'type' => 'dropdown',
170 'def_value' => 'DESC',
171 'holder' => '',
172 'class' => 'order',
173 'value' =>array (
174 'DESC' => __('Descending', 'auxin-elements'),
175 'ASC' => __('Ascending', 'auxin-elements'),
176 ),
177 'admin_label' => false,
178 'dependency' => '',
179 'weight' => '',
180 'group' => __( 'Query', 'auxin-elements' ),
181 'edit_field_class' => ''
182 ),
183 array(
184 'heading' => __('Only posts','auxin-elements' ),
185 'description' => __('If you intend to display ONLY specific posts, you should specify the posts here. You have to insert the post IDs that are separated by comma (eg. 53,34,87,25).', 'auxin-elements' ),
186 'param_name' => 'only_posts__in',
187 'type' => 'textfield',
188 'value' => '',
189 'holder' => '',
190 'class' => '',
191 'admin_label' => false,
192 'dependency' => '',
193 'weight' => '',
194 'group' => __( 'Query', 'auxin-elements' ),
195 'edit_field_class' => ''
196 ),
197 array(
198 'heading' => __('Include posts','auxin-elements' ),
199 'description' => __('If you intend to include additional posts, you should specify the posts here. You have to insert the Post IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
200 'param_name' => 'include',
201 'type' => 'textfield',
202 'value' => '',
203 'holder' => '',
204 'class' => '',
205 'admin_label' => false,
206 'dependency' => '',
207 'weight' => '',
208 'group' => __( 'Query', 'auxin-elements' ),
209 'edit_field_class' => ''
210 ),
211 array(
212 'heading' => __('Exclude posts','auxin-elements' ),
213 'description' => __('If you intend to exclude specific posts from result, you should specify the posts here. You have to insert the Post IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
214 'param_name' => 'exclude',
215 'type' => 'textfield',
216 'value' => '',
217 'holder' => '',
218 'class' => '',
219 'admin_label' => false,
220 'dependency' => '',
221 'weight' => '',
222 'group' => __( 'Query', 'auxin-elements' ),
223 'edit_field_class' => ''
224 ),
225 array(
226 'heading' => __('Start offset','auxin-elements' ),
227 'description' => __('Number of post to displace or pass over.', 'auxin-elements' ),
228 'param_name' => 'offset',
229 'type' => 'textfield',
230 'value' => '',
231 'holder' => '',
232 'class' => '',
233 'admin_label' => false,
234 'dependency' => '',
235 'weight' => '',
236 'group' => __( 'Query', 'auxin-elements' ),
237 'edit_field_class' => ''
238 ),
239 array(
240 'heading' => __('Display post media (image, video, etc)', 'auxin-elements' ),
241 'param_name' => 'show_media',
242 'type' => 'aux_switch',
243 'def_value' => '',
244 'value' => '1',
245 'holder' => '',
246 'class' => 'show_media',
247 'admin_label' => false,
248 'dependency' => '',
249 'weight' => '',
250 'group' => '',
251 'edit_field_class' => ''
252 ),
253 array(
254 'heading' => __('Display post title','auxin-elements' ),
255 'description' => '',
256 'param_name' => 'display_title',
257 'type' => 'aux_switch',
258 'value' => '1',
259 'class' => 'display_title',
260 'admin_label' => false,
261 'dependency' => '',
262 'weight' => '',
263 'group' => '',
264 'edit_field_class' => ''
265 ),
266 array(
267 'heading' => __('Display post meta','auxin-elements' ),
268 'description' => '',
269 'param_name' => 'show_info',
270 'type' => 'aux_switch',
271 'value' => '1',
272 'class' => '',
273 'admin_label' => false,
274 'weight' => '',
275 'group' => '',
276 'edit_field_class' => ''
277 ),
278 array(
279 'heading' => __('Display like button','auxin-elements' ),
280 'description' => sprintf(__('Enable it to display %s like button%s on gride template blog. Please note WP Ulike plugin needs to be activaited to use this option.', 'auxin-elements'), '<strong>', '</strong>'),
281 'param_name' => 'display_like',
282 'type' => 'aux_switch',
283 'value' => '1',
284 'holder' => '',
285 'class' => 'display_like',
286 'admin_label' => false,
287 'dependency' => '',
288 'weight' => '',
289 'group' => '',
290 'edit_field_class' => ''
291 ),
292 array(
293 'heading' => __('Load More Type','auxin-elements' ),
294 'description' => '',
295 'param_name' => 'loadmore_type',
296 'type' => 'aux_visual_select',
297 'value' => 'scroll',
298 'class' => 'loadmore_type',
299 'admin_label' => false,
300 'dependency' => '',
301 'weight' => '',
302 'group' => '' ,
303 'edit_field_class' => '',
304 'choices' => array(
305 '' => array(
306 'label' => __('None', 'auxin-elements' ),
307 'image' => AUXIN_URL . 'images/visual-select/load-more-none.svg'
308 ),
309 'scroll' => array(
310 'label' => __('Infinite Scroll', 'auxin-elements' ),
311 'image' => AUXIN_URL . 'images/visual-select/load-more-infinite.svg'
312 ),
313 'next' => array(
314 'label' => __('Next Button', 'auxin-elements' ),
315 'image' => AUXIN_URL . 'images/visual-select/load-more-button.svg'
316 ),
317 'next-prev' => array(
318 'label' => __('Next Prev', 'auxin-elements' ),
319 'image' => AUXIN_URL . 'images/visual-select/load-more-next-prev.svg'
320 )
321 )
322 ),
323 array(
324 'heading' => __('Excerpt length','auxin-elements' ),
325 'description' => __('Specify summary content in character.','auxin-elements' ),
326 'param_name' => 'excerpt_len',
327 'type' => 'textfield',
328 'value' => '160',
329 'holder' => '',
330 'class' => 'excerpt_len',
331 'admin_label' => false,
332 'dependency' => '',
333 'weight' => '',
334 'group' => '',
335 'edit_field_class' => ''
336 ),
337 array(
338 'heading' => __('Display author or read more', 'auxin-elements'),
339 'description' => __('Specifies whether to show author or read more on each post.', 'auxin-elements'),
340 'param_name' => 'author_or_readmore',
341 'type' => 'dropdown',
342 'def_value' => 'readmore',
343 'holder' => '',
344 'class' => 'author_or_readmore',
345 'value' => array (
346 'readmore' => __('Read More', 'auxin-elements'),
347 'author' => __('Author Name', 'auxin-elements'),
348 ),
349 'admin_label' => false,
350 'dependency' => '',
351 'weight' => '',
352 'group' => '',
353 'edit_field_class' => ''
354 ),
355 array(
356 'heading' => __('Number of columns', 'auxin-elements'),
357 'description' => '',
358 'param_name' => 'desktop_cnum',
359 'type' => 'dropdown',
360 'def_value' => '4',
361 'holder' => '',
362 'class' => 'desktop_cnum',
363 'value' => array(
364 '1' => '1', '2' => '2', '3' => '3',
365 '4' => '4', '5' => '5', '6' => '6'
366 ),
367 'admin_label' => false,
368 'dependency' => '',
369 'weight' => '',
370 'group' => __( 'Layout', 'auxin-elements' ),
371 'edit_field_class' => ''
372 ),
373 array(
374 'heading' => __('Number of columns in tablet size', 'auxin-elements'),
375 'description' => '',
376 'param_name' => 'tablet_cnum',
377 'type' => 'dropdown',
378 'value' => 'inherit',
379 'holder' => '',
380 'class' => 'tablet_cnum',
381 'value' => array(
382 'inherit' => 'Inherited from larger',
383 '1' => '1', '2' => '2', '3' => '3',
384 '4' => '4', '5' => '5', '6' => '6'
385 ),
386 'admin_label' => false,
387 'dependency' => '',
388 'weight' => '',
389 'group' => __( 'Layout', 'auxin-elements' ),
390 'edit_field_class' => ''
391 ),
392 array(
393 'heading' => __('Number of columns in phone size', 'auxin-elements'),
394 'description' => '',
395 'param_name' => 'phone_cnum',
396 'type' => 'dropdown',
397 'def_value' => '1',
398 'holder' => '',
399 'class' => 'phone_cnum',
400 'value' => array(
401 '1' => '1' , '2' => '2', '3' => '3'
402 ),
403 'admin_label' => false,
404 'dependency' => '',
405 'weight' => '',
406 'group' => __( 'Layout', 'auxin-elements' ),
407 'edit_field_class' => ''
408 ),
409 array(
410 'heading' => __('Extra class name','auxin-elements' ),
411 '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' ),
412 'param_name' => 'extra_classes',
413 'type' => 'textfield',
414 'value' => '',
415 'def_value' => '',
416 'holder' => '',
417 'class' => 'extra_classes',
418 'admin_label' => false,
419 'dependency' => '',
420 'weight' => '',
421 'group' => '',
422 'edit_field_class' => ''
423 )
424 )
425 );
426
427 return $master_array;
428 }
429
430 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_recent_posts_masonry_master_array', 10, 1 );
431
432
433
434
435 /**
436 * Element without loop and column
437 * The front-end output of this element is returned by the following function
438 *
439 * @param array $atts The array containing the parsed values from shortcode, it should be same as defined params above.
440 * @param string $shortcode_content The shorcode content
441 * @return string The output of element markup
442 */
443 function auxin_widget_recent_posts_masonry_callback( $atts, $shortcode_content = null ){
444
445 // Defining default attributes
446 $default_atts = array(
447 'title' => '', // header title
448 'cat' => ' ',
449 'num' => '8', // max generated entry
450 'only_posts__in' => '', // display only these post IDs. array or string comma separated
451 'include' => '', // include these post IDs in result too. array or string comma separated
452 'exclude' => '', // exclude these post IDs from result. array or string comma separated
453 'offset' => '',
454 'paged' => '',
455 'order_by' => 'date',
456 'order' => 'DESC',
457 'exclude_without_media' => 0,
458 'exclude_custom_post_formats' => 0,
459 'exclude_quote_link' => 0,
460 'exclude_post_formats_in' => array(), // the list od post formats to exclude
461 'show_media' => true,
462 'display_like' => true,
463 'display_comments' => true,
464 'display_categories' => true,
465 'max_taxonomy_num' => '',
466 'content_layout' => '', // entry-boxed
467 'post_info_position' => 'after-title', // entry-boxed
468 'excerpt_len' => '160',
469 'display_title' => true,
470 'show_excerpt' => true,
471 'show_content' => true,
472 'show_info' => true,
473 'show_date' => true,
474 'author_or_readmore' => 'readmore',
475 'display_author_header' => true,
476 'display_author_footer' => false,
477 // 'image_aspect_ratio' => 0.75,
478 'desktop_cnum' => 4,
479 'tablet_cnum' => 'inherit',
480 'phone_cnum' => '1',
481 'tag' => '',
482
483 'crop' => false,
484 'preloadable' => false,
485 'preload_preview' => true,
486 'preload_bgcolor' => '',
487
488 'extra_classes' => '',
489 'extra_column_classes' => '',
490 'custom_el_id' => '',
491 'taxonomy_name' => 'category',
492
493 'template_part_file' => 'theme-parts/entry/post-column',
494 'extra_template_path' => '',
495
496 'universal_id' => '',
497 'reset_query' => true,
498 'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
499 'wp_query_args' => array(), // additional wp_query args
500 'loadmore_type' => '', // 'next' (more button), 'scroll', 'next-prev'
501 'loadmore_per_page' => '',
502 'base' => 'aux_recent_posts_masonry',
503 'base_class' => 'aux-widget-recent-posts-masonry aux-column-post-entry'
504 );
505
506 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
507 extract( $result['parsed_atts'] );
508
509 $display_author_footer = auxin_is_true( $display_author_footer );
510 $display_author_header = auxin_is_true( $display_author_header );
511
512 // specify the post formats that should be excluded -------
513 $exclude_post_formats_in = (array) $exclude_post_formats_in;
514
515 if( $exclude_custom_post_formats ){
516 $exclude_post_formats_in = array_merge( $exclude_post_formats_in, array( 'aside', 'gallery', 'image', 'link', 'quote', 'video', 'audio' ) );
517 }
518 if( $exclude_quote_link ){
519 $exclude_post_formats_in[] = 'quote';
520 $exclude_post_formats_in[] = 'link';
521 }
522 $exclude_post_formats_in = array_unique( $exclude_post_formats_in );
523
524 // --------------
525
526 ob_start();
527
528 $tax_args = array();
529 if( ! empty( $cat ) && $cat != " " && ( ! is_array( $cat ) || ! in_array( " ", $cat ) ) ) {
530 $tax_args = array(
531 array(
532 'taxonomy' => $taxonomy_name,
533 'field' => 'term_id',
534 'terms' => ! is_array( $cat ) ? explode( ",", $cat ) : $cat
535 )
536 );
537 }
538
539 global $wp_query;
540
541 if( ! $use_wp_query ){
542
543 // create wp_query to get latest items -----------
544 $args = array(
545 'post_type' => 'post',
546 'orderby' => $order_by,
547 'order' => $order,
548 'offset' => $offset,
549 'paged' => $paged,
550 'tax_query' => $tax_args,
551 'post_status' => 'publish',
552 'posts_per_page' => $num,
553 'ignore_sticky_posts' => 1,
554
555 'include_posts__in' => $include, // include posts in this list
556 'posts__not_in' => $exclude, // exclude posts in this list
557 'posts__in' => $only_posts__in, // only posts in this list
558
559 'exclude_without_media' => $exclude_without_media,
560 'exclude_post_formats_in' => $exclude_post_formats_in
561 );
562
563 // ---------------------------------------------------------------------
564
565 // add the additional query args if available
566 if( $wp_query_args ){
567 $args = wp_parse_args( $args, $wp_query_args );
568 }
569
570 // pass the args through the auxin query parser
571 $wp_query = new WP_Query( auxin_parse_query_args( $args ) );
572 }
573
574 // widget header ------------------------------
575 echo wp_kses_post( $result['widget_header'] );
576 echo wp_kses_post( $result['widget_title'] );
577
578
579 $phone_break_point = 767;
580 $tablet_break_point = 1025;
581
582 $show_comments = true; // shows comments icon
583 $post_counter = 0;
584 $post_classes = '';
585 $column_class = '';
586 $item_class = 'aux-col aux-post-masonry';
587 $carousel_attrs = '';
588 $container_class = 'aux-masonry-layout ';
589
590 if( ! empty( $loadmore_type ) ) {
591 $item_class .= ' aux-ajax-item';
592 }
593
594 // generate columns class
595 $column_class = $container_class . ' aux-de-col' . $desktop_cnum;
596 $tablet_cnum = ('inherit' == $tablet_cnum ) ? $desktop_cnum : $tablet_cnum ;
597 $column_class .= ' aux-tb-col'.$tablet_cnum . ' aux-mb-col'.$phone_cnum;
598 $column_class .= 'entry-boxed' == $content_layout ? ' aux-entry-boxed' : '';
599
600 $column_class .= ' aux-ajax-view ' . $extra_column_classes;
601
602 $column_media_width = auxin_get_content_column_width( $desktop_cnum, 15, $content_width );
603
604 $have_posts = $wp_query->have_posts();
605
606 if( $have_posts ){
607
608 echo ! $skip_wrappers ? sprintf( '<div data-element-id="%s" class="%s">', esc_attr( $universal_id ), esc_attr( $column_class ) ) : '';
609
610 while ( $wp_query->have_posts() ) {
611
612 $wp_query->the_post();
613 $post = $wp_query->post;
614
615 $post_vars = auxin_get_post_format_media(
616 $post,
617 array(
618 'request_from' => 'archive',
619 'media_width' => $phone_break_point,
620 'media_size' => 'large',//array( 'width' => $column_media_width, 'height' => $column_media_width * $image_aspect_ratio ),
621 'upscale_image' => true,
622 'crop' => $crop,
623 'image_from_content' => ! $exclude_without_media, // whether to try to get image from content or not
624 'no_gallery' => false,
625 'add_image_hw' => false, // whether add width and height attr or not
626 'preloadable' => $preloadable,
627 'preload_preview' => $preload_preview,
628 'preload_bgcolor' => $preload_bgcolor,
629 'image_sizes' => 'auto',
630 'srcset_sizes' => 'auto'
631 )
632 );
633
634 extract( $post_vars );
635
636 $the_format = get_post_format( $post );
637
638 // add specific class to current classes for each column
639 $post_classes = $has_attach && $show_media ? 'post column-entry' : 'post column-entry no-media';
640
641 printf( '<div class="%s post-%s">', esc_attr( $item_class ), esc_attr( $post->ID ) );
642 include auxin_get_template_file( $template_part_file, '', $extra_template_path );
643 echo '</div>';
644 }
645
646 if( ! $skip_wrappers ) {
647 // End tag for aux-ajax-view wrapper
648 echo '</div>';
649 // Execute load more functionality
650 if( $wp_query->found_posts > $loadmore_per_page ) {
651 echo auxin_get_load_more_controller( $loadmore_type );
652 }
653
654 } else {
655 // Get post counter in the query
656 echo '<span class="aux-post-count hidden">'. esc_html( $wp_query->post_count ) .'</span>';
657 echo '<span class="aux-all-posts-count hidden">'. esc_html( $wp_query->found_posts ) .'</span>';
658 }
659
660 }
661
662 if( $reset_query ){
663 wp_reset_query();
664 }
665
666 // return false if no result found
667 if( ! $have_posts ){
668 ob_get_clean();
669 return false;
670 }
671
672 // widget footer ------------------------------
673 echo wp_kses_post( $result['widget_footer'] );
674
675 return ob_get_clean();
676 }
677