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