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