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