PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.17.14
Shortcodes and extra features for Phlox theme v2.17.14
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-carousel.php
auxin-elements / includes / elements Last commit date
about-widget.php 1 year ago accordion-widget.php 1 year ago accordion.php 1 year ago attachment-url.php 1 year ago audio.php 1 year ago before-after.php 1 year ago button.php 1 year ago code.php 1 year ago contact-box.php 1 year ago contact-form.php 1 year ago custom-list.php 6 months ago divider.php 1 year ago dropcap.php 1 year ago facebook.php 1 year ago flickr.php 1 year ago gallery.php 1 year ago gmap.php 1 year ago highlight.php 1 year ago image.php 1 year ago instagram-feed.php 1 year ago latest-posts-slider.php 1 year ago popular-posts-widget.php 1 year ago products-grid.php 1 year ago quote.php 1 year ago recent-posts-grid-carousel.php 1 year ago recent-posts-land-style.php 1 year ago recent-posts-masonry.php 1 year ago recent-posts-tiles-carousel.php 1 year ago recent-posts-tiles.php 1 year ago recent-posts-timeline.php 1 year ago recent-posts-widget.php 1 year ago recent-products.php 1 year ago related-posts.php 8 years ago sample-element.php 1 year ago search.php 1 year ago socials-list.php 1 year ago staff.php 1 year ago tab-widget.php 1 year ago tabs.php 1 year ago testimonial.php 1 year ago text.php 1 year ago touch-slider.php 1 year ago video.php 1 year ago
recent-posts-tiles-carousel.php
792 lines
1 <?php
2 /**
3 * Recent Posts Tiles in Carousel Mode
4 *
5 *
6 * @package Auxin
7 * @license LICENSE.txt
8 * @author averta
9 * @link http://phlox.pro/
10 * @copyright (c) 2010-2025 averta
11 */
12
13 function auxin_get_recent_posts_tiles_carousel_master_array( $master_array ) {
14
15 $master_array['aux_recent_posts_tiles_carousel'] = array(
16 'name' => __('Recent Posts Tiles Carousel', 'auxin-elements' ),
17 'auxin_output_callback' => 'auxin_widget_recent_posts_tiles_carousel_callback',
18 'base' => 'aux_recent_posts_tiles_carousel',
19 'description' => __('It adds recent posts in tiles carousel mode.', 'auxin-elements' ),
20 'class' => 'aux-widget-recent-posts-tiles aux-carousel',
21 'show_settings_on_create' => true,
22 'weight' => 1,
23 'is_widget' => false,
24 'is_shortcode' => true,
25 'category' => THEME_NAME,
26 'group' => '',
27 'admin_enqueue_js' => '',
28 'admin_enqueue_css' => '',
29 'front_enqueue_js' => '',
30 'front_enqueue_css' => '',
31 'icon' => 'aux-element aux-pb-icons-tile',
32 'custom_markup' => '',
33 'js_view' => '',
34 'html_template' => '',
35 'deprecated' => '',
36 'content_element' => '',
37 'as_parent' => '',
38 'as_child' => '',
39 'params' => array(
40 array(
41 'heading' => __('Title','auxin-elements' ),
42 'description' => __('Recent post title, leave it empty if you don`t need title.', 'auxin-elements'),
43 'param_name' => 'title',
44 'type' => 'textfield',
45 'value' => '',
46 'holder' => 'textfield',
47 'class' => 'title',
48 'admin_label' => false,
49 'dependency' => '',
50 'weight' => '',
51 'group' => '',
52 'edit_field_class' => ''
53 ),
54 array(
55 'heading' => __('Categories', 'auxin-elements'),
56 'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
57 'param_name' => 'cat',
58 'type' => 'aux_taxonomy',
59 'taxonomy' => 'category',
60 'def_value' => ' ',
61 'holder' => '',
62 'class' => 'cat',
63 'admin_label' => false,
64 'dependency' => '',
65 'weight' => '',
66 'group' => __( 'Query', 'auxin-elements' ),
67 'edit_field_class' => ''
68 ),
69 array(
70 'heading' => __('Number of posts to show in per page', 'auxin-elements'),
71 'description' => '',
72 'param_name' => 'num',
73 'type' => 'textfield',
74 'value' => '5',
75 'holder' => '',
76 'class' => 'num',
77 'admin_label' => false,
78 'dependency' => '',
79 'weight' => '',
80 'group' => __( 'Query', 'auxin-elements' ),
81 'edit_field_class' => ''
82 ),
83 array(
84 'heading' => __('Number of Pages', 'auxin-elements'),
85 'description' => '',
86 'param_name' => 'page',
87 'type' => 'textfield',
88 'value' => '2',
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' => '1',
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' => '1',
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' => '1',
129 'class' => '',
130 'admin_label' => false,
131 'dependency' => array(
132 'element' => 'exclude_custom_post_formats',
133 'value' => '0'
134 ),
135 'weight' => '',
136 'group' => __( 'Query', 'auxin-elements' ),
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' => __('Order by', 'auxin-elements'),
226 'description' => '',
227 'param_name' => 'order_by',
228 'type' => 'dropdown',
229 'def_value' => 'date',
230 'holder' => '',
231 'class' => 'order_by',
232 'value' => array (
233 'date' => __('Date', 'auxin-elements'),
234 'menu_order date' => __('Menu Order', 'auxin-elements'),
235 'title' => __('Title', 'auxin-elements'),
236 'ID' => __('ID', 'auxin-elements'),
237 'rand' => __('Random', 'auxin-elements'),
238 'comment_count' => __('Comments', 'auxin-elements'),
239 'modified' => __('Date Modified', 'auxin-elements'),
240 'author' => __('Author', 'auxin-elements'),
241 'post__in' => __('Inserted Post IDs', 'auxin-elements')
242 ),
243 'admin_label' => false,
244 'dependency' => '',
245 'weight' => '',
246 'group' => __( 'Query', 'auxin-elements' ),
247 'edit_field_class' => ''
248 ),
249 array(
250 'heading' => __('Order', 'auxin-elements'),
251 'description' => '',
252 'param_name' => 'order',
253 'type' => 'dropdown',
254 'def_value' => 'DESC',
255 'holder' => '',
256 'class' => 'order',
257 'value' =>array (
258 'DESC' => __('Descending', 'auxin-elements'),
259 'ASC' => __('Ascending', 'auxin-elements'),
260 ),
261 'admin_label' => false,
262 'dependency' => '',
263 'weight' => '',
264 'group' => __( 'Query', 'auxin-elements' ),
265 'edit_field_class' => ''
266 ),
267 array(
268 'heading' => __('Start offset','auxin-elements' ),
269 'description' => __('Number of post to displace or pass over.', 'auxin-elements' ),
270 'param_name' => 'offset',
271 'type' => 'textfield',
272 'value' => '',
273 'holder' => '',
274 'class' => '',
275 'admin_label' => false,
276 'dependency' => '',
277 'weight' => '',
278 'group' => __( 'Query', 'auxin-elements' ),
279 'edit_field_class' => ''
280 ),
281 array(
282 'heading' => __( 'Post Tile styles','auxin-elements' ),
283 'description' => '',
284 'param_name' => 'tile_style_pattern',
285 'type' => 'aux_visual_select',
286 'def_value' => 'default',
287 'holder' => '',
288 'class' => 'tile_style_pattern',
289 'admin_label' => false,
290 'dependency' => '',
291 'weight' => '',
292 'group' => __( 'Style', 'auxin-elements' ),
293 'edit_field_class' => '',
294 'choices' => array(
295 'default' => array(
296 'label' => __( 'Default', 'auxin-elements' ),
297 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-5.svg'
298 ),
299 'pattern-1' => array(
300 'label' => __( 'Pattern 1', 'auxin-elements' ),
301 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-3.svg'
302 ),
303 'pattern-2' => array(
304 'label' => __( 'Pattern 2', 'auxin-elements' ),
305 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-6.svg'
306 ),
307 'pattern-3' => array(
308 'label' => __( 'Pattern 3', 'auxin-elements' ),
309 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-7.svg'
310 ),
311 'pattern-4' => array(
312 'label' => __( 'Pattern 4', 'auxin-elements' ),
313 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-8.svg'
314 ),
315 'pattern-5' => array(
316 'label' => __( 'Pattern 5', 'auxin-elements' ),
317 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-4.svg'
318 ),
319 'pattern-6' => array(
320 'label' => __('Pattern 6', 'auxin-elements' ),
321 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-1.svg'
322 ),
323 'pattern-7' => array(
324 'label' => __('Pattern 7', 'auxin-elements' ),
325 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/tile-2.svg'
326 ),
327 )
328 ),
329 array(
330 'heading' => __('Post tile style','auxin-elements' ),
331 'description' => '',
332 'param_name' => 'tile_style',
333 'type' => 'dropdown',
334 'def_value' => '',
335 'holder' => '',
336 'class' => 'tile_style',
337 'admin_label' => false,
338 'dependency' => '',
339 'weight' => '',
340 'group' => __( 'Style', 'auxin-elements' ),
341 'edit_field_class' => '',
342 'value' => array(
343 'dark' => __('Dark', 'auxin-elements'),
344 'light' => __('Light', 'auxin-elements'),
345 'light-overlay' => __('Light Overlay', 'auxin-elements'),
346 ),
347 ),
348 array(
349 'heading' => __('Button Navigation Style','auxin-elements' ),
350 'description' => '',
351 'param_name' => 'button_style',
352 'type' => 'aux_visual_select',
353 'def_value' => '',
354 'holder' => '',
355 'class' => 'button_style',
356 'admin_label' => false,
357 'dependency' => array(
358 'element' => 'carousel_navigation_control',
359 'value' => 'arrows'
360 ),
361 'weight' => '',
362 'group' => __( 'Style', 'auxin-elements' ),
363 'edit_field_class' => '',
364 'choices' => array(
365 'pattern-1' => array(
366 'label' => __('Pattern 1', 'auxin-elements' ),
367 'image' => AUXIN_URL . 'images/visual-select/button-normal.svg'
368 ),
369 'pattern-2' => array(
370 'label' => __('Pattern 2', 'auxin-elements' ),
371 'image' => AUXIN_URL . 'images/visual-select/button-curved.svg'
372 ),
373 ),
374 ),
375 array(
376 'heading' => __('Insert post title','auxin-elements' ),
377 'description' => '',
378 'param_name' => 'display_title',
379 'type' => 'aux_switch',
380 'value' => '1',
381 'class' => 'display_title',
382 'admin_label' => false,
383 'dependency' => '',
384 'weight' => '',
385 'group' => '' ,
386 'edit_field_class' => ''
387 ),
388 array(
389 'heading' => __('Insert post meta','auxin-elements' ),
390 'description' => '',
391 'param_name' => 'show_info',
392 'type' => 'aux_switch',
393 'value' => '1',
394 'class' => '',
395 'admin_label' => false,
396 'weight' => '',
397 'group' => '' ,
398 'edit_field_class' => ''
399 ),
400 array(
401 'heading' => __('Navigation type', 'auxin-elements'),
402 'description' => '',
403 'param_name' => 'carousel_navigation',
404 'type' => 'dropdown',
405 'def_value' => 'peritem',
406 'holder' => '',
407 'class' => 'num',
408 'value' => array(
409 'peritem' => __('Move per column', 'auxin-elements'),
410 'perpage' => __('Move per page', 'auxin-elements'),
411 'scroll' => __('Smooth scroll', 'auxin-elements'),
412 ),
413 'admin_label' => false,
414 'dependency' => array(
415 'element' => 'preview_mode',
416 'value' => 'carousel'
417 ),
418 'weight' => '',
419 'group' => __( 'Carousel', 'auxin-elements' ),
420 'edit_field_class' => ''
421 ),
422 array(
423 'heading' => __('Navigation control', 'auxin-elements'),
424 'description' => '',
425 'param_name' => 'carousel_navigation_control',
426 'type' => 'dropdown',
427 'def_value' => 'arrows',
428 'holder' => '',
429 'class' => 'num',
430 'value' => array(
431 'arrows' => __('Arrows', 'auxin-elements'),
432 'bullets' => __('Bullets', 'auxin-elements'),
433 '' => __('None', 'auxin-elements'),
434 ),
435 'dependency' => array(
436 'element' => 'preview_mode',
437 'value' => 'carousel'
438 ),
439 'weight' => '',
440 'admin_label' => false,
441 'group' => __( 'Carousel', 'auxin-elements' ),
442 'edit_field_class' => ''
443 ),
444 array(
445 'heading' => __('Loop navigation','auxin-elements' ),
446 'description' => '',
447 'param_name' => 'carousel_loop',
448 'type' => 'aux_switch',
449 'value' => '1',
450 'class' => '',
451 'dependency' => array(
452 'element' => 'preview_mode',
453 'value' => 'carousel'
454 ),
455 'weight' => '',
456 'group' => __( 'Carousel', 'auxin-elements' ),
457 'edit_field_class' => ''
458 ),
459 array(
460 'heading' => __('Autoplay carousel','auxin-elements' ),
461 'description' => '',
462 'param_name' => 'carousel_autoplay',
463 'type' => 'aux_switch',
464 'value' => '0',
465 'class' => '',
466 'admin_label' => false,
467 'dependency' => array(
468 'element' => 'preview_mode',
469 'value' => 'carousel'
470 ),
471 'weight' => '',
472 'group' => __( 'Carousel', 'auxin-elements' ),
473 'edit_field_class' => ''
474 ),
475 array(
476 'heading' => __('Autoplay delay','auxin-elements' ),
477 'description' => __('Specifies the delay between auto-forwarding in seconds.', 'auxin-elements' ),
478 'param_name' => 'carousel_autoplay_delay',
479 'type' => 'textfield',
480 'value' => '2',
481 'holder' => '',
482 'class' => 'excerpt_len',
483 'admin_label' => false,
484 'dependency' => array(
485 'element' => 'preview_mode',
486 'value' => 'carousel'
487 ),
488 'weight' => '',
489 'group' => __( 'Carousel', 'auxin-elements' ),
490 'edit_field_class' => ''
491 ),
492 array(
493 'heading' => __('Extra class name','auxin-elements' ),
494 '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' ),
495 'param_name' => 'extra_classes',
496 'type' => 'textfield',
497 'value' => '',
498 'holder' => '',
499 'class' => 'extra_classes',
500 'admin_label' => false,
501 'dependency' => '',
502 'weight' => '',
503 'group' => '',
504 'edit_field_class' => ''
505 )
506 )
507 );
508
509 return $master_array;
510 }
511
512 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_recent_posts_tiles_carousel_master_array', 10, 1 );
513
514
515
516
517 /**
518 * Element without loop and column
519 * The front-end output of this element is returned by the following function
520 *
521 * @param array $atts The array containing the parsed values from shortcode, it should be same as defined params above.
522 * @param string $shortcode_content The shorcode content
523 * @return string The output of element markup
524 */
525 function auxin_widget_recent_posts_tiles_carousel_callback( $atts, $shortcode_content = null ){
526
527 global $aux_content_width;
528
529 // Defining default attributes
530 $default_atts = array(
531 'title' => '', // header title
532 'cat' => ' ',
533 'num' => '5', // max generated entry
534 'only_posts__in' => '', // display only these post IDs. array or string comma separated
535 'include' => '', // include these post IDs in result too. array or string comma separated
536 'exclude' => '', // exclude these post IDs from result. array or string comma separated
537 'posts_per_page' => -1,
538 'offset' => '',
539 'paged' => '',
540 'order_by' => 'date',
541 'order' => 'DESC',
542 'excerpt_len' => '160',
543 'exclude_without_media' => true,
544 'exclude_custom_post_formats' => true,
545 'page' => '2',
546 'exclude_quote_link' => true,
547 'exclude_post_formats_in' => array(), // the list od post formats to exclude
548 'tile_style' => 'light',
549 'tile_style_pattern' => 'default',
550 'button_style' => 'pattern-1',
551 'display_title' => true,
552 'show_info' => true,
553 'show_date' => true,
554 'display_categories' => true,
555 // 'preloadable' => false,
556 // 'preload_preview' => true,
557 // 'preload_bgcolor' => '',
558 'extra_classes' => '',
559 'extra_column_classes' => '',
560 'custom_el_id' => '',
561 'taxonomy_name' => 'category',
562 'template_part_file' => 'theme-parts/entry/post-tile',
563 'extra_template_path' => '',
564 'universal_id' => '',
565 'reset_query' => true,
566 'carousel_autoplay' => false,
567 'carousel_navigation' => 'peritem',
568 'carousel_navigation_control' => 'arrows',
569 'carousel_autoplay_delay' => '2',
570 'carousel_loop' => 1,
571 'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
572 'wp_query_args' => array(), // additional wp_query args
573 'loadmore_type' => '', // 'next' (more button), 'scroll', 'next-prev'
574 'loadmore_per_page' => '',
575 'base' => 'aux_recent_posts_tiles_carousel',
576 'base_class' => 'aux-widget-recent-posts-tiles aux-carousel'
577 );
578
579 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
580 extract( $result['parsed_atts'] );
581
582 $acceptedTemplateFiles = apply_filters( 'auxin_recent_posts_tiles_carousel_accepted_template_files', [
583 'theme-parts/entry/post-column',
584 'theme-parts/entry/post-flip',
585 'theme-parts/entry/post-land',
586 'theme-parts/entry/post-tile',
587 'theme-parts/entry/post',
588 ]);
589
590 if ( ! in_array( $template_part_file, $acceptedTemplateFiles ) ) {
591 return;
592 }
593
594 // specify the post formats that should be excluded -------
595 $exclude_post_formats_in = (array) $exclude_post_formats_in;
596
597 if( $exclude_custom_post_formats ){
598 $exclude_post_formats_in = array_merge( $exclude_post_formats_in, array( 'aside', 'gallery', 'image', 'link', 'quote', 'video', 'audio' ) );
599 }
600 if( $exclude_quote_link ){
601 $exclude_post_formats_in[] = 'quote';
602 $exclude_post_formats_in[] = 'link';
603 }
604 $exclude_post_formats_in = array_unique( $exclude_post_formats_in );
605
606 // --------------
607
608 ob_start();
609
610 $tax_args = array();
611 if( ! empty( $cat ) && $cat != " " && ( ! is_array( $cat ) || ! in_array( " ", $cat ) ) ) {
612 $tax_args = array(
613 array(
614 'taxonomy' => $taxonomy_name,
615 'field' => 'term_id',
616 'terms' => ! is_array( $cat ) ? explode( ",", $cat ) : $cat
617 )
618 );
619 }
620
621 global $wp_query;
622
623 if( ! $use_wp_query ){
624
625 // create wp_query to get latest items -----------
626 $args = array(
627 'post_type' => 'post',
628 'orderby' => $order_by,
629 'order' => $order,
630 'offset' => $offset,
631 'tax_query' => $tax_args,
632 'post_status' => 'publish',
633 'posts_per_page' => $num * $page,
634 'ignore_sticky_posts' => 1,
635 'include_posts__in' => $include, // include posts in this liat
636 'posts__not_in' => $exclude, // exclude posts in this list
637 'posts__in' => $only_posts__in, // only posts in this list
638
639 'exclude_without_media' => $exclude_without_media,
640 'exclude_post_formats_in' => $exclude_post_formats_in
641 );
642
643 // ---------------------------------------------------------------------
644
645 // add the additional query args if available
646 if( $wp_query_args ){
647 $args = wp_parse_args( $args, $wp_query_args );
648 }
649
650 // pass the args through the auxin query parser
651 $wp_query = new WP_Query( auxin_parse_query_args( $args ) );
652 }
653
654 // widget header ------------------------------
655 echo wp_kses_post( $result['widget_header'] );
656 echo wp_kses_post( $result['widget_title'] );
657
658 $tile_style = 'aux-tile-' . esc_attr( $tile_style ) . ' ';
659 $phone_break_point = 767;
660 $tablet_break_point = 1025;
661
662 $show_comments = true; // shows comments icon
663 $post_counter = 0;
664 $item_class = 'aux-post-tile aux-image-box';
665
666 if( ! empty( $loadmore_type ) ) {
667 $item_class .= ' aux-ajax-item';
668 }
669
670 $container_class = 'master-carousel aux-no-js aux-mc-before-init ' . $tile_style;
671
672 $have_posts = $wp_query->have_posts();
673
674 if( $have_posts ){
675
676
677 echo ! $skip_wrappers ? sprintf( '<div data-lazyload="true" data-element-id="%s" class="%s" data-columns="1" data-autoplay="%s" data-navigation="%s" data-loop="%s" data-delay="%s" data-wrap-controls="true" data-bullets="%s" data-bullet-class="aux-bullets aux-small aux-mask" data-arrows="%s" data-same-height="false">',
678 esc_attr( $universal_id ),
679 esc_attr( $container_class ),
680 esc_attr( $carousel_autoplay ),
681 esc_attr( $carousel_navigation ),
682 esc_attr( $carousel_loop ),
683 esc_attr( $carousel_autoplay_delay ),
684 'bullets' == $carousel_navigation_control ? 'true' : 'false',
685 'arrows' == $carousel_navigation_control ? 'true' : 'false'
686 ) : '';
687
688 while ( $wp_query->have_posts() ) {
689 $item_pattern_info = auxin_get_tile_pattern( $tile_style_pattern , $post_counter, $aux_content_width );
690
691 $post_counter++;
692
693 if ( ( $post_counter % $num ) == 1 ){
694 echo '<div class="aux-mc-item aux-tiles-layout">';
695 }
696
697
698 $wp_query->the_post();
699 $post = $wp_query->post;
700
701
702 $post_vars = auxin_get_post_format_media(
703 $post,
704 array(
705 'request_from' => 'archive',
706 'media_width' => $phone_break_point,
707 'media_size' => $item_pattern_info['size'],
708 'upscale_image' => true,
709 'image_from_content' => ! $exclude_without_media,
710 'ignore_formats' => array( '*' ),
711 'preloadable' => false,
712 'image_sizes' => 'auto',
713 'srcset_sizes' => 'auto'
714 )
715 );
716
717 extract( $post_vars );
718
719 $post_classes = $item_class .' post '. $item_pattern_info['classname'];
720
721 $the_format = get_post_format( $post );
722
723 include auxin_get_template_file( $template_part_file, '', $extra_template_path );
724
725 if ( ( $post_counter % $num ) == 0 ){
726 $post_counter = 0;
727 echo '</div>';
728 }
729
730 }
731 if ( $page != 1 && 'bullets' != $carousel_navigation_control ) {
732 ?>
733 <div class="aux-carousel-controls">
734 <?php if ( $button_style === 'pattern-1' ) { ?>
735 <div class="aux-next-arrow aux-arrow-nav aux-outline aux-hover-fill">
736 <span class="aux-svg-arrow aux-small-right"></span>
737 <span class="aux-hover-arrow aux-white aux-svg-arrow aux-small-right"></span>
738 </div>
739 <div class="aux-prev-arrow aux-arrow-nav aux-outline aux-hover-fill">
740 <span class="aux-svg-arrow aux-small-left"></span>
741 <span class="aux-hover-arrow aux-white aux-svg-arrow aux-small-left"></span>
742 </div>
743 <?php } else { ?>
744 <div class="aux-next-arrow aux-arrow-nav aux-hover-slide aux-round aux-outline aux-medium">
745 <span class="aux-overlay"></span>
746 <span class="aux-svg-arrow aux-medium-right"></span>
747 <span class="aux-hover-arrow aux-svg-arrow aux-medium-right aux-white"></span>
748 </div>
749 <div class="aux-prev-arrow aux-arrow-nav aux-hover-slide aux-round aux-outline aux-medium">
750 <span class="aux-overlay"></span>
751 <span class="aux-svg-arrow aux-medium-left"></span>
752 <span class="aux-hover-arrow aux-svg-arrow aux-medium-left aux-white"></span>
753 </div>
754 <?php } ?>
755 </div>
756
757 <?php
758 }
759
760 if( ! $skip_wrappers ) {
761 // End tag for aux-ajax-view wrapper
762 echo '</div>';
763 // Execute load more functionality
764 if( $wp_query->found_posts > $loadmore_per_page ) {
765 echo auxin_get_load_more_controller( $loadmore_type );
766 }
767
768 } else {
769 // Get post counter in the query
770 echo '<span class="aux-post-count hidden">'. esc_html( $wp_query->post_count ) .'</span>';
771 echo '<span class="aux-all-posts-count hidden">'. esc_html( $wp_query->found_posts ) .'</span>';
772 }
773 }
774
775 if( $reset_query ){
776 wp_reset_query();
777 }
778
779 // return false if no result found
780 if( ! $have_posts ){
781 ob_get_clean();
782 return false;
783 }
784
785 // widget footer ------------------------------
786 echo wp_kses_post( $result['widget_footer'] );
787
788 return ob_get_clean();
789 }
790
791
792