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