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