PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.16.1
Shortcodes and extra features for Phlox theme v2.16.1
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-grid-carousel.php
auxin-elements / includes / elements Last commit date
about-widget.php 2 years ago accordion-widget.php 2 years ago accordion.php 2 years ago attachment-url.php 2 years ago audio.php 2 years ago before-after.php 2 years ago button.php 2 years ago code.php 2 years ago contact-box.php 2 years ago contact-form.php 2 years ago custom-list.php 2 years ago divider.php 2 years ago dropcap.php 2 years ago facebook.php 2 years ago flickr.php 2 years ago gallery.php 2 years ago gmap.php 2 years ago highlight.php 2 years ago image.php 2 years ago instagram-feed.php 2 years ago latest-posts-slider.php 2 years ago popular-posts-widget.php 2 years ago products-grid.php 2 years ago quote.php 2 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 2 years ago recent-products.php 2 years ago related-posts.php 8 years ago sample-element.php 2 years ago search.php 2 years ago socials-list.php 2 years ago staff.php 2 years ago tab-widget.php 2 years ago tabs.php 2 years ago testimonial.php 2 years ago text.php 2 years ago touch-slider.php 2 years ago video.php 2 years ago
recent-posts-grid-carousel.php
1181 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-2024 averta
11 */
12
13 function auxin_get_recent_posts_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'] = array(
29 'name' => __('Grid & Carousel Recent Posts', 'auxin-elements' ),
30 'auxin_output_callback' => 'auxin_widget_recent_posts_callback',
31 'base' => 'aux_recent_posts',
32 'description' => __('It adds recent posts in grid or carousel mode.', 'auxin-elements' ),
33 'class' => 'aux-widget-recent-posts',
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-grid',
45 'custom_markup' => '',
46 'js_view' => '',
47 'html_template' => '',
48 'deprecated' => '',
49 'content_element' => '',
50 'as_parent' => '',
51 'as_child' => '',
52 'params' => array(
53 array(
54 'heading' => __('Title','auxin-elements' ),
55 'description' => __('Recent post title, leave it empty if you don`t need title.', 'auxin-elements'),
56 'param_name' => 'title',
57 'type' => 'textfield',
58 'value' => '',
59 'holder' => 'textfield',
60 'class' => 'title',
61 'admin_label' => false,
62 'dependency' => '',
63 'weight' => '',
64 'group' => '',
65 'edit_field_class' => ''
66 ),
67 array(
68 'heading' => __('Subtitle','auxin-elements' ),
69 'description' => __('Recent posts subtitle, leave it empty if you don`t need title.', 'auxin-elements'),
70 'param_name' => 'subtitle',
71 'type' => 'textfield',
72 'value' => '',
73 'holder' => 'textfield',
74 'class' => 'title',
75 'admin_label' => false,
76 'dependency' => '',
77 'weight' => '',
78 'group' => '',
79 'edit_field_class' => ''
80 ),
81 array(
82 'heading' => __('Categories', 'auxin-elements'),
83 'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ),
84 'param_name' => 'cat',
85 'type' => 'aux_select2_multiple',
86 'def_value' => ' ',
87 'holder' => '',
88 'class' => 'cat',
89 'value' => $categories_list,
90 'admin_label' => false,
91 'dependency' => '',
92 'weight' => '',
93 'group' => __( 'Query', 'auxin-elements' ),
94 'edit_field_class' => ''
95 ),
96 array(
97 'heading' => __('Number of posts to show', 'auxin-elements'),
98 'description' => '',
99 'param_name' => 'num',
100 'type' => 'textfield',
101 'value' => '8',
102 'holder' => '',
103 'class' => 'num',
104 'admin_label' => false,
105 'dependency' => '',
106 'weight' => '',
107 'group' => __( 'Query', 'auxin-elements' ),
108 'edit_field_class' => ''
109 ),
110 array(
111 'heading' => __('Image aspect ratio', 'auxin-elements'),
112 'description' => '',
113 'param_name' => 'image_aspect_ratio',
114 'type' => 'dropdown',
115 'def_value' => '0.75',
116 'holder' => '',
117 'class' => 'order',
118 'value' =>array (
119 '0.75' => __('Horizontal 4:3' , 'auxin-elements'),
120 '0.56' => __('Horizontal 16:9', 'auxin-elements'),
121 '1.00' => __('Square 1:1' , 'auxin-elements'),
122 '1.33' => __('Vertical 3:4' , 'auxin-elements')
123 ),
124 'admin_label' => false,
125 'dependency' => '',
126 'weight' => '',
127 'group' => '',
128 'edit_field_class' => ''
129 ),
130 array(
131 'heading' => __('Exclude posts without media','auxin-elements' ),
132 'description' => '',
133 'param_name' => 'exclude_without_media',
134 'type' => 'aux_switch',
135 'value' => '0',
136 'class' => '',
137 'admin_label' => false,
138 'dependency' => '',
139 'weight' => '',
140 'group' => __( 'Query', 'auxin-elements' ),
141 'edit_field_class' => ''
142 ),
143 array(
144 'heading' => __('Exclude custom post formats','auxin-elements' ),
145 'description' => '',
146 'param_name' => 'exclude_custom_post_formats',
147 'type' => 'aux_switch',
148 'value' => '0',
149 'class' => '',
150 'admin_label' => false,
151 'dependency' => '',
152 'weight' => '',
153 'group' => __( 'Query', 'auxin-elements' ),
154 'edit_field_class' => ''
155 ),
156 array(
157 'heading' => __('Exclude quote and link post formats','auxin-elements' ),
158 'description' => '',
159 'param_name' => 'exclude_quote_link',
160 'type' => 'aux_switch',
161 'value' => '0',
162 'class' => '',
163 'admin_label' => false,
164 'dependency' => array(
165 'element' => 'exclude_custom_post_formats',
166 'value' => array('0', 'false')
167 ),
168 'weight' => '',
169 'group' => '',
170 'edit_field_class' => ''
171 ),
172 array(
173 'heading' => __('Order by', 'auxin-elements'),
174 'description' => '',
175 'param_name' => 'order_by',
176 'type' => 'dropdown',
177 'def_value' => 'date',
178 'holder' => '',
179 'class' => 'order_by',
180 'value' => array (
181 'date' => __('Date', 'auxin-elements'),
182 'menu_order date' => __('Menu Order', 'auxin-elements'),
183 'title' => __('Title', 'auxin-elements'),
184 'ID' => __('ID', 'auxin-elements'),
185 'rand' => __('Random', 'auxin-elements'),
186 'comment_count' => __('Comments', 'auxin-elements'),
187 'modified' => __('Date Modified', 'auxin-elements'),
188 'author' => __('Author', 'auxin-elements'),
189 'post__in' => __('Inserted Post IDs', 'auxin-elements')
190 ),
191 'admin_label' => false,
192 'dependency' => '',
193 'weight' => '',
194 'group' => __( 'Query', 'auxin-elements' ),
195 'edit_field_class' => ''
196 ),
197 array(
198 'heading' => __('Order', 'auxin-elements'),
199 'description' => '',
200 'param_name' => 'order',
201 'type' => 'dropdown',
202 'def_value' => 'DESC',
203 'holder' => '',
204 'class' => 'order',
205 'value' =>array (
206 'DESC' => __('Descending', 'auxin-elements'),
207 'ASC' => __('Ascending', 'auxin-elements'),
208 ),
209 'admin_label' => false,
210 'dependency' => '',
211 'weight' => '',
212 'group' => __( 'Query', 'auxin-elements' ),
213 'edit_field_class' => ''
214 ),
215 array(
216 'heading' => __('Only posts','auxin-elements' ),
217 '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' ),
218 'param_name' => 'only_posts__in',
219 'type' => 'textfield',
220 'value' => '',
221 'holder' => '',
222 'class' => '',
223 'admin_label' => false,
224 'dependency' => '',
225 'weight' => '',
226 'group' => __( 'Query', 'auxin-elements' ),
227 'edit_field_class' => ''
228 ),
229 array(
230 'heading' => __('Include posts','auxin-elements' ),
231 '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' ),
232 'param_name' => 'include',
233 'type' => 'textfield',
234 'value' => '',
235 'holder' => '',
236 'class' => '',
237 'admin_label' => false,
238 'dependency' => '',
239 'weight' => '',
240 'group' => __( 'Query', 'auxin-elements' ),
241 'edit_field_class' => ''
242 ),
243 array(
244 'heading' => __('Exclude posts','auxin-elements' ),
245 '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' ),
246 'param_name' => 'exclude',
247 'type' => 'textfield',
248 'value' => '',
249 'holder' => '',
250 'class' => '',
251 'admin_label' => false,
252 'dependency' => '',
253 'weight' => '',
254 'group' => __( 'Query', 'auxin-elements' ),
255 'edit_field_class' => ''
256 ),
257 array(
258 'heading' => __('Start offset','auxin-elements' ),
259 'description' => __('Number of post to displace or pass over.', 'auxin-elements' ),
260 'param_name' => 'offset',
261 'type' => 'textfield',
262 'value' => '',
263 'holder' => '',
264 'class' => '',
265 'admin_label' => false,
266 'dependency' => '',
267 'weight' => '',
268 'group' => __( 'Query', 'auxin-elements' ),
269 'edit_field_class' => ''
270 ),
271 array(
272 'heading' => __('Display post media (image, video, etc)', 'auxin-elements' ),
273 'param_name' => 'show_media',
274 'type' => 'aux_switch',
275 'def_value' => '',
276 'value' => '1',
277 'holder' => '',
278 'class' => 'show_media',
279 'admin_label' => false,
280 'dependency' => '',
281 'weight' => '',
282 'group' => '',
283 'edit_field_class' => ''
284 ),
285 array(
286 'heading' => __('Display post title','auxin-elements' ),
287 'description' => '',
288 'param_name' => 'display_title',
289 'type' => 'aux_switch',
290 'value' => '1',
291 'class' => 'display_title',
292 'admin_label' => false,
293 'dependency' => '',
294 'weight' => '',
295 'group' => '',
296 'edit_field_class' => ''
297 ),
298 array(
299 'heading' => __('Display post info','auxin-elements' ),
300 'description' => '',
301 'param_name' => 'show_info',
302 'type' => 'aux_switch',
303 'value' => '1',
304 'class' => '',
305 'admin_label' => false,
306 'weight' => '',
307 'group' => '',
308 'edit_field_class' => ''
309 ),
310 array(
311 'heading' => __('Display post content','auxin-elements' ),
312 'description' => '',
313 'param_name' => 'show_content',
314 'type' => 'aux_switch',
315 'value' => '1',
316 'class' => '',
317 'admin_label' => false,
318 'weight' => '',
319 'group' => '',
320 'edit_field_class' => ''
321 ),
322 array(
323 'heading' => __('Post info position', 'auxin-elements' ),
324 'description' => '',
325 'param_name' => 'post_info_position',
326 'type' => 'dropdown',
327 'def_value' => 'after-title',
328 'holder' => '',
329 'class' => 'post_info_position',
330 'value' => array (
331 'after-title' => __('After Title' , 'auxin-elements' ),
332 'before-title' => __('Before Title', 'auxin-elements' )
333 ),
334 'admin_label' => false,
335 'dependency' => array(
336 'element' => 'show_info',
337 'value' => '1'
338 ),
339 'weight' => '',
340 'group' => '',
341 'edit_field_class' => ''
342 ),
343 array(
344 'heading' => __('Display Categories','auxin-elements' ),
345 'description' => '',
346 'param_name' => 'display_categories',
347 'type' => 'aux_switch',
348 'value' => '1',
349 'holder' => '',
350 'class' => 'display_categories',
351 'admin_label' => false,
352 'dependency' => array(
353 'element' => 'show_info',
354 'value' => '1'
355 ),
356 'weight' => '',
357 'group' => '',
358 'edit_field_class' => ''
359 ),
360 array(
361 'heading' => __('Display Date','auxin-elements' ),
362 'description' => '',
363 'param_name' => 'show_date',
364 'type' => 'aux_switch',
365 'value' => '1',
366 'holder' => '',
367 'class' => 'show_date',
368 'admin_label' => false,
369 'dependency' => array(
370 'element' => 'show_info',
371 'value' => '1'
372 ),
373 'weight' => '',
374 'group' => '',
375 'edit_field_class' => ''
376 ),
377 array(
378 'heading' => __('Display like button','auxin-elements' ),
379 '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>'),
380 'param_name' => 'display_like',
381 'type' => 'aux_switch',
382 'value' => '1',
383 'holder' => '',
384 'class' => 'display_like',
385 'admin_label' => false,
386 'dependency' => '',
387 'weight' => '',
388 'group' => '',
389 'edit_field_class' => ''
390 ),
391 array(
392 'heading' => __('Load More Type','auxin-elements' ),
393 'description' => '',
394 'param_name' => 'loadmore_type',
395 'type' => 'aux_visual_select',
396 'value' => '',
397 'class' => 'loadmore_type',
398 'admin_label' => false,
399 'dependency' => '',
400 'weight' => '',
401 'group' => '' ,
402 'edit_field_class' => '',
403 'choices' => array(
404 '' => array(
405 'label' => __('None', 'auxin-elements' ),
406 'image' => AUXIN_URL . 'images/visual-select/load-more-none.svg'
407 ),
408 'scroll' => array(
409 'label' => __('Infinite Scroll', 'auxin-elements' ),
410 'image' => AUXIN_URL . 'images/visual-select/load-more-infinite.svg'
411 ),
412 'next' => array(
413 'label' => __('Next Button', 'auxin-elements' ),
414 'image' => AUXIN_URL . 'images/visual-select/load-more-button.svg'
415 ),
416 'next-prev' => array(
417 'label' => __('Next Prev', 'auxin-elements' ),
418 'image' => AUXIN_URL . 'images/visual-select/load-more-next-prev.svg'
419 )
420 )
421 ),
422 array(
423 'heading' => __('Excerpt length','auxin-elements' ),
424 'description' => __('Specify summary content in character.','auxin-elements' ),
425 'param_name' => 'excerpt_len',
426 'type' => 'textfield',
427 'value' => '160',
428 'holder' => '',
429 'class' => 'excerpt_len',
430 'admin_label' => false,
431 'dependency' => '',
432 'weight' => '',
433 'group' => '',
434 'edit_field_class' => ''
435 ),
436 array(
437 'heading' => __('Display author or read more', 'auxin-elements'),
438 'description' => __('Specifies whether to show author or read more on each post.', 'auxin-elements'),
439 'param_name' => 'author_or_readmore',
440 'type' => 'dropdown',
441 'def_value' => 'readmore',
442 'holder' => '',
443 'class' => 'author_or_readmore',
444 'value' =>array (
445 'readmore' => __( 'Read More' , 'auxin-elements' ),
446 'author' => __( 'Author Name', 'auxin-elements' ),
447 'none' => __( 'None' , 'auxin-elements' )
448 ),
449 'admin_label' => false,
450 'dependency' => '',
451 'weight' => '',
452 'group' => '',
453 'edit_field_class' => ''
454 ),
455 array(
456 'heading' => __('Meta Info position', 'auxin-elements' ),
457 'description' => '',
458 'param_name' => 'meta_info_position',
459 'type' => 'dropdown',
460 'def_value' => 'after-title',
461 'holder' => '',
462 'class' => 'meta_info_position',
463 'value' => array (
464 'after-content' => __('After Content' , 'auxin-elements' ),
465 'before-content' => __('Before Content', 'auxin-elements' )
466 ),
467 'admin_label' => false,
468 'weight' => '',
469 'group' => '',
470 'edit_field_class' => ''
471 ),
472 array(
473 'heading' => __('Number of columns', 'auxin-elements'),
474 'description' => '',
475 'param_name' => 'desktop_cnum',
476 'type' => 'dropdown',
477 'def_value' => '4',
478 'holder' => '',
479 'class' => 'num',
480 'value' => array(
481 '1' => '1', '2' => '2', '3' => '3',
482 '4' => '4', '5' => '5', '6' => '6'
483 ),
484 'admin_label' => false,
485 'dependency' => '',
486 'weight' => '',
487 'group' => __( 'Layout', 'auxin-elements' ),
488 'edit_field_class' => ''
489 ),
490 array(
491 'heading' => __('Number of columns in tablet size', 'auxin-elements'),
492 'description' => '',
493 'param_name' => 'tablet_cnum',
494 'type' => 'dropdown',
495 'def_value' => 'inherit',
496 'holder' => '',
497 'class' => 'num',
498 'value' => array(
499 'inherit' => 'Inherited from larger',
500 '1' => '1', '2' => '2', '3' => '3',
501 '4' => '4', '5' => '5', '6' => '6'
502 ),
503 'admin_label' => false,
504 'dependency' => '',
505 'weight' => '',
506 'group' => __( 'Layout', 'auxin-elements' ),
507 'edit_field_class' => ''
508 ),
509 array(
510 'heading' => __('Number of columns in phone size', 'auxin-elements'),
511 'description' => '',
512 'param_name' => 'phone_cnum',
513 'type' => 'dropdown',
514 'def_value' => '1',
515 'holder' => '',
516 'class' => 'num',
517 'value' => array(
518 '1' => '1', '2' => '2', '3' => '3'
519 ),
520 'admin_label' => false,
521 'dependency' => '',
522 'weight' => '',
523 'group' => __( 'Layout', 'auxin-elements' ),
524 'edit_field_class' => ''
525 ),
526 array(
527 'heading' => __('Display items as', 'auxin-elements'),
528 'description' => '',
529 'param_name' => 'preview_mode',
530 'type' => 'dropdown',
531 'def_value' => 'grid',
532 'holder' => 'textfield',
533 'class' => 'num',
534 'value' => array(
535 'grid' => __( 'Grid', 'auxin-elements' ),
536 'grid-table' => __( 'Grid - Table Style', 'auxin-elements' ),
537 'grid-modern' => __( 'Grid - Modern Style', 'auxin-elements' ),
538 'carousel-modern'=> __( 'Carousel - Modern Style', 'auxin-elements' ),
539 'carousel' => __( 'Carousel', 'auxin-elements' )
540 ),
541 'admin_label' => false,
542 'dependency' => '',
543 'weight' => '',
544 'group' => '',
545 'edit_field_class' => ''
546 ),
547 array(
548 'heading' => __('Content layout', 'auxin-elements'),
549 'description' => __('Specifies the style of content for each post column.', 'auxin-elements' ),
550 'param_name' => 'content_layout',
551 'type' => 'dropdown',
552 'def_value' => 'default',
553 'holder' => '',
554 'class' => 'content_layout',
555 'value' =>array (
556 'default' => __('Full Content', 'auxin-elements'),
557 'entry-boxed' => __('Boxed Content', 'auxin-elements')
558 ),
559 'admin_label' => false,
560 'dependency' => array(
561 'element' => 'preview_mode',
562 'value' => array( 'grid', 'grid-table' )
563 ),
564 'weight' => '',
565 'group' => '',
566 'edit_field_class' => ''
567 ),
568 array(
569 'heading' => __('Mouse Over Effect', 'auxin-elements'),
570 'description' => '',
571 'param_name' => 'grid_table_hover',
572 'type' => 'dropdown',
573 'def_value' => 'bgimage-bgcolor',
574 'holder' => '',
575 'class' => 'num',
576 'value' => array(
577 'bgcolor' => __( 'Background color', 'auxin-elements' ),
578 'bgimage' => __( 'Cover image', 'auxin-elements' ),
579 'bgimage-bgcolor' => __( 'Cover image or background color', 'auxin-elements' ),
580 'none' => __( 'Nothing', 'auxin-elements' )
581 ),
582 'admin_label' => false,
583 'dependency' => array(
584 'element' => 'preview_mode',
585 'value' => 'grid-table'
586 ),
587 'weight' => '',
588 'group' => '',
589 'edit_field_class' => ''
590 ),
591 // Carousel Options
592 array(
593 'heading' => __( 'Column space', 'auxin-elements' ),
594 'description' => __( 'Specifies horizontal space between items (pixel).', 'auxin-elements' ),
595 'param_name' => 'carousel_space',
596 'type' => 'textfield',
597 'value' => '30',
598 'holder' => '',
599 'class' => 'excerpt_len',
600 'admin_label' => false,
601 'dependency' => array(
602 'element' => 'preview_mode',
603 'value' => 'grid'
604 ),
605 'weight' => '',
606 'group' => '',
607 'edit_field_class' => ''
608 ),
609 array(
610 'heading' => __('Navigation type', 'auxin-elements'),
611 'description' => '',
612 'param_name' => 'carousel_navigation',
613 'type' => 'dropdown',
614 'def_value' => 'peritem',
615 'holder' => '',
616 'class' => 'num',
617 'value' => array(
618 'peritem' => __('Move per column', 'auxin-elements'),
619 'perpage' => __('Move per page', 'auxin-elements'),
620 'scroll' => __('Smooth scroll', 'auxin-elements'),
621 ),
622 'admin_label' => false,
623 'dependency' => array(
624 'element' => 'preview_mode',
625 'value' => array( 'carousel', 'carousel-modern' )
626 ),
627 'weight' => '',
628 'group' => __( 'Carousel', 'auxin-elements' ),
629 'edit_field_class' => ''
630 ),
631 array(
632 'heading' => __('Navigation control', 'auxin-elements'),
633 'description' => '',
634 'param_name' => 'carousel_navigation_control',
635 'type' => 'dropdown',
636 'def_value' => 'bullets',
637 'holder' => '',
638 'class' => 'num',
639 'value' => array(
640 'arrows' => __('Arrows', 'auxin-elements'),
641 'bullets' => __('Bullets', 'auxin-elements'),
642 '' => __('None', 'auxin-elements'),
643 ),
644 'dependency' => array(
645 'element' => 'preview_mode',
646 'value' => array( 'carousel', 'carousel-modern' )
647 ),
648 'weight' => '',
649 'admin_label' => false,
650 'group' => __( 'Carousel', 'auxin-elements' ),
651 'edit_field_class' => ''
652 ),
653 array(
654 'heading' => __('Control Position', 'auxin-elements'),
655 'description' => '',
656 'param_name' => 'carousel_nav_control_pos',
657 'type' => 'dropdown',
658 'def_value' => 'center',
659 'holder' => '',
660 'value' => array(
661 'center' => __('Center', 'auxin-elements'),
662 'side' => __('Side', 'auxin-elements'),
663 ),
664 'dependency' => array(
665 'element' => 'carousel_navigation_control',
666 'value' => 'arrows'
667 ),
668 'weight' => '',
669 'admin_label' => false,
670 'group' => __( 'Carousel', 'auxin-elements' ),
671 'edit_field_class' => ''
672 ),
673 array(
674 'heading' => __('Control Skin', 'auxin-elements'),
675 'description' => '',
676 'param_name' => 'carousel_nav_control_skin',
677 'type' => 'dropdown',
678 'def_value' => 'boxed',
679 'holder' => '',
680 'value' => array(
681 'boxed' => __('boxed', 'auxin-elements'),
682 'long' => __('Long Arrow', 'auxin-elements'),
683 ),
684 'dependency' => array(
685 'element' => 'carousel_navigation_control',
686 'value' => 'arrows'
687 ),
688 'weight' => '',
689 'admin_label' => false,
690 'group' => __( 'Carousel', 'auxin-elements' ),
691 'edit_field_class' => ''
692 ),
693 array(
694 'heading' => __('Loop navigation','auxin-elements' ),
695 'description' => '',
696 'param_name' => 'carousel_loop',
697 'type' => 'aux_switch',
698 'value' => '1',
699 'class' => '',
700 'dependency' => array(
701 'element' => 'preview_mode',
702 'value' => array( 'carousel', 'carousel-modern' )
703 ),
704 'weight' => '',
705 'group' => __( 'Carousel', 'auxin-elements' ),
706 'edit_field_class' => ''
707 ),
708 array(
709 'heading' => __('Autoplay carousel','auxin-elements' ),
710 'description' => '',
711 'param_name' => 'carousel_autoplay',
712 'type' => 'aux_switch',
713 'value' => '0',
714 'class' => '',
715 'admin_label' => false,
716 'dependency' => array(
717 'element' => 'preview_mode',
718 'value' => array( 'carousel', 'carousel-modern' )
719 ),
720 'weight' => '',
721 'group' => __( 'Carousel', 'auxin-elements' ),
722 'edit_field_class' => ''
723 ),
724 array(
725 'heading' => __('Autoplay delay','auxin-elements' ),
726 'description' => __('Specifies the delay between auto-forwarding in seconds.', 'auxin-elements' ),
727 'param_name' => 'carousel_autoplay_delay',
728 'type' => 'textfield',
729 'value' => '2',
730 'holder' => '',
731 'class' => 'excerpt_len',
732 'admin_label' => false,
733 'dependency' => array(
734 'element' => 'preview_mode',
735 'value' => array( 'carousel', 'carousel-modern' )
736 ),
737 'weight' => '',
738 'group' => __( 'Carousel', 'auxin-elements' ),
739 'edit_field_class' => ''
740 ),
741 array(
742 'heading' => __('Extra class name','auxin-elements' ),
743 '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' ),
744 'param_name' => 'extra_classes',
745 'type' => 'textfield',
746 'value' => '',
747 'def_value' => '',
748 'holder' => '',
749 'class' => 'extra_classes',
750 'admin_label' => false,
751 'dependency' => '',
752 'weight' => '',
753 'group' => '',
754 'edit_field_class' => ''
755 )
756 )
757 );
758
759 return $master_array;
760 }
761
762 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_recent_posts_master_array', 10, 1 );
763
764
765
766
767 /**
768 * Element without loop and column
769 * The front-end output of this element is returned by the following function
770 *
771 * @param array $atts The array containing the parsed values from shortcode, it should be same as defined params above.
772 * @param string $shortcode_content The shorcode content
773 * @return string The output of element markup
774 */
775 function auxin_widget_recent_posts_callback( $atts, $shortcode_content = null ){
776
777 // Defining default attributes
778 $default_atts = array(
779 'title' => '', // header title (required)
780 'subtitle' => '', // header title (required)
781 'cat' => ' ',
782 'num' => '8', // max generated entry
783 'only_posts__in' => '', // display only these post IDs. array or string comma separated
784 'include' => '', // include these post IDs in result too. array or string comma separated
785 'exclude' => '', // exclude these post IDs from result. array or string comma separated
786 'offset' => '',
787 'paged' => '',
788 'post_type' => 'post',
789 'taxonomy_name' => 'category', // the taxonomy that we intent to display in post info
790 'order_by' => 'date',
791 'order' => 'DESC',
792
793 'exclude_without_media' => 0,
794 'exclude_custom_post_formats' => 0,
795 'exclude_quote_link' => 0,
796 'include_post_formats_in' => array(), // the list od post formats to exclude
797 'exclude_post_formats_in' => array(), // the list od post formats to exclude
798
799 'size' => '',
800 'display_title' => true,
801 'words_num' => '',
802 'show_media' => true,
803 'display_like' => true,
804 'display_comments' => true,
805 'display_categories' => true,
806 'max_taxonomy_num' => '',
807 'show_badge' => false,
808 'content_layout' => '', // entry-boxed
809 'excerpt_len' => '160',
810 'show_excerpt' => true,
811 'show_content' => true,
812 'show_info' => true,
813 'show_format_icon' => false,
814 'show_date' => true,
815 'ignore_formats' => false,
816 'post_info_position' => 'after-title',
817 'author_or_readmore' => 'readmore', // readmore, author, none
818 'image_aspect_ratio' => 0.75,
819 'meta_info_position' => 'after-content',
820 'desktop_cnum' => 4,
821 'tablet_cnum' => 'inherit',
822 'phone_cnum' => '1',
823 'preview_mode' => 'grid',
824 'grid_table_hover' => 'bgimage-bgcolor',
825 'tag' => '',
826 'display_author_footer' => false,
827 'display_author_header' => true,
828
829 'preloadable' => false,
830 'preload_preview' => true,
831 'preload_bgcolor' => '',
832
833 'extra_classes' => '',
834 'extra_column_classes' => '',
835 'custom_el_id' => '',
836 'carousel_space' => '30',
837 'carousel_autoplay' => false,
838 'carousel_autoplay_delay' => '2',
839 'carousel_navigation' => 'peritem',
840 'carousel_navigation_control' => 'arrows',
841 'carousel_nav_control_pos' => 'center',
842 'carousel_nav_control_skin' => 'boxed',
843 'carousel_loop' => 1,
844 'request_from' => '',
845 'template_part_file' => 'theme-parts/entry/post-column',
846 'extra_template_path' => '',
847
848 'universal_id' => '',
849 'use_wp_query' => false, // true to use the global wp_query, false to use internal custom query
850 'reset_query' => true,
851 'wp_query_args' => array(), // additional wp_query args
852 'custom_wp_query' => '',
853 'loadmore_type' => '', // 'next' (more button), 'scroll', 'next-prev'
854 'loadmore_per_page' => '',
855 'base' => 'aux_recent_posts',
856 'base_class' => 'aux-widget-recent-posts'
857 );
858
859 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
860 extract( $result['parsed_atts'] );
861
862 $acceptedTemplateFiles = apply_filters( 'auxin_recent_posts_accepted_template_files', [
863 'theme-parts/entry/post-column',
864 'theme-parts/entry/post-flip',
865 'theme-parts/entry/post-land',
866 'theme-parts/entry/post-tile',
867 'theme-parts/entry/post',
868 'woocommerce/content-product'
869 ]);
870
871 if ( ! in_array( $template_part_file, $acceptedTemplateFiles ) ) {
872 return;
873 }
874
875 // Validate the boolean variables
876 $exclude_without_media = auxin_is_true( $exclude_without_media );
877 $display_like = auxin_is_true( $display_like );
878 $display_title = auxin_is_true( $display_title );
879 $show_info = auxin_is_true( $show_info );
880 $display_author_footer = auxin_is_true( $display_author_footer );
881 $display_author_header = auxin_is_true( $display_author_header );
882
883 // specify the post formats that should be excluded -------
884 $exclude_post_formats_in = (array) $exclude_post_formats_in;
885
886 if( auxin_is_true( $exclude_custom_post_formats ) ){
887 $exclude_post_formats_in = array_merge( $exclude_post_formats_in, array( 'aside', 'gallery', 'image', 'link', 'quote', 'video', 'audio' ) );
888 }
889 if( $exclude_quote_link ){
890 $exclude_post_formats_in[] = 'quote';
891 $exclude_post_formats_in[] = 'link';
892 }
893 $exclude_post_formats_in = array_unique( $exclude_post_formats_in );
894
895 // --------------
896
897 ob_start();
898
899 $tax_args = array();
900 if( ! empty( $cat ) && $cat != " " && ( ! is_array( $cat ) || ! in_array( " ", $cat ) ) ) {
901 $tax_args = array(
902 array(
903 'taxonomy' => $taxonomy_name,
904 'field' => 'term_id',
905 'terms' => ! is_array( $cat ) ? explode( ",", $cat ) : $cat
906 )
907 );
908 }
909
910 if( $custom_wp_query ){
911 $wp_query = $custom_wp_query;
912
913 } elseif( ! $use_wp_query ){
914
915 // create wp_query to get latest items ---------------------------------
916 $args = array(
917 'post_type' => $post_type,
918 'orderby' => $order_by,
919 'order' => $order,
920 'offset' => $offset,
921 'paged' => $paged,
922 'tax_query' => $tax_args,
923 'post_status' => 'publish',
924 'posts_per_page' => $num,
925 'ignore_sticky_posts' => 1,
926
927 'include_posts__in' => $include, // include posts in this list
928 'posts__not_in' => $exclude, // exclude posts in this list
929 'posts__in' => $only_posts__in, // only posts in this list
930
931 'exclude_without_media' => $exclude_without_media,
932 'exclude_post_formats_in' => $exclude_post_formats_in,
933 'include_post_formats_in' => $include_post_formats_in
934 );
935
936 // ---------------------------------------------------------------------
937
938 // add the additional query args if available
939 if( $wp_query_args ){
940 $args = wp_parse_args( $wp_query_args, $args );
941 }
942
943 // pass the args through the auxin query parser
944 $wp_query = new WP_Query( auxin_parse_query_args( $args ) );
945 } else {
946 global $wp_query;
947 }
948
949
950 // widget header ------------------------------
951 echo wp_kses_post( $result['widget_header'] );
952 echo wp_kses_post( $result['widget_title'] );
953
954 echo $subtitle ? '<h4 class="widget-subtitle">' . esc_html( $subtitle ) . '</h4>' : '';
955
956
957 $phone_break_point = 767;
958 $tablet_break_point = 1025;
959
960 $show_comments = true; // shows comments icon
961 $post_counter = 0;
962 $column_class = '';
963 $item_class = 'aux-col';
964
965 $columns_custom_styles = '';
966
967 if( ! empty( $loadmore_type ) ) {
968 $item_class .= ' aux-ajax-item';
969 }
970
971 $tablet_cnum = ('inherit' == $tablet_cnum ) ? $desktop_cnum : $tablet_cnum ;
972 $phone_cnum = ('inherit' == $phone_cnum ) ? $tablet_cnum : $phone_cnum;
973
974 if ( in_array( $preview_mode, array( 'grid', 'grid-table', 'grid-modern', 'flip' ) ) ) {
975 // generate columns class
976 $column_class = 'aux-match-height aux-row aux-de-col' . $desktop_cnum;
977
978 $column_class .= ' aux-tb-col'.$tablet_cnum . ' aux-mb-col'.$phone_cnum . ' aux-total-'. $wp_query->post_count;
979
980 $column_class .= 'entry-boxed' == $content_layout ? ' aux-entry-boxed' : '';
981
982 if ( 'flip' == $preview_mode ) {
983 $column_class .= ' aux-flip-box';
984 }
985
986 } elseif ( in_array( $preview_mode, array('carousel', 'carousel-modern') ) ) {
987 $column_class = 'master-carousel aux-no-js aux-mc-before-init' . ' aux-' . $carousel_nav_control_pos . '-control';
988 $item_class = 'aux-mc-item';
989 }
990
991 if ( 'grid-table' == $preview_mode ) {
992 $column_class .= ' aux-grid-table-layout aux-border-collapse';
993 $column_class .= 'none' != $grid_table_hover ? ' aux-has-bghover' : '';
994
995 $show_media = false;
996 }
997
998 if ( in_array( $preview_mode, array('grid-modern', 'carousel-modern') ) ) {
999 $column_class .= ' aux-grid-carousel-modern-layout';
1000 }
1001
1002 $ignore_formats = auxin_is_true( $ignore_formats ) ? array( '*' ) : array();
1003
1004 // Specifies whether the columns have footer meta or not
1005 $column_class .= 'none' === $author_or_readmore ? ' aux-no-meta' : '';
1006 $column_class .= ' aux-ajax-view ' . $extra_column_classes;
1007
1008 // automatically calculate the media size if was empty
1009 $column_media_width = auxin_get_content_column_width( $desktop_cnum, 15, $content_width );
1010 if( empty( $size ) ){
1011 $size = array( 'width' => $column_media_width, 'height' => $column_media_width * $image_aspect_ratio );
1012 }
1013
1014 $have_posts = $wp_query->have_posts();
1015
1016 if( $have_posts ){
1017
1018 if ( ! $skip_wrappers ) {
1019 if ( in_array( $preview_mode, array('carousel', 'carousel-modern') ) ) {
1020 echo sprintf( '<div data-element-id="%s" class="%s" data-same-height="true" data-wrap-controls="true" data-bullet-class="aux-bullets aux-small aux-mask" %s %s %s %s %s %s %s %s %s >',
1021 esc_attr( $universal_id ),
1022 esc_attr( $column_class ),
1023 'data-columns="' . esc_attr( $desktop_cnum ) . '"',
1024 auxin_is_true( $carousel_autoplay ) ? ' data-autoplay="true"' : '',
1025 auxin_is_true( $carousel_autoplay ) ? ' data-delay="' . esc_attr( $carousel_autoplay_delay ) . '"' : '',
1026 'data-navigation="' . esc_attr( $carousel_navigation ) . '"',
1027 'data-space="' . esc_attr( $carousel_space ). '"',
1028 auxin_is_true( $carousel_loop ) ? ' data-loop="' . esc_attr( $carousel_loop ) . '"' : '',
1029 'data-bullets="' . ('bullets' == $carousel_navigation_control ? 'true' : 'false') . '"',
1030 'data-arrows="' . ('arrows' == $carousel_navigation_control ? 'true' : 'false') . '"',
1031 ( 'inherit' != $tablet_cnum || 'inherit' != $phone_cnum ) ? 'data-responsive="'. esc_attr( ( 'inherit' != $tablet_cnum ? $tablet_break_point . ':' . $tablet_cnum . ',' : '' ) . ( 'inherit' != $phone_cnum ? $phone_break_point . ':' . $phone_cnum : '' ) ) . '"' : ''
1032 );
1033 } else {
1034 echo sprintf( '<div data-element-id="%s" class="%s">', esc_attr( $universal_id ), esc_attr( $column_class ) );
1035 }
1036 }
1037
1038 while ( $wp_query->have_posts() ) {
1039
1040 $wp_query->the_post();
1041 $post = get_post();
1042
1043 $post_vars = auxin_get_post_type_media_args(
1044 $post,
1045 array(
1046 'post_type' => $post_type,
1047 'request_from' => $request_from,
1048 'media_width' => $phone_break_point,
1049 'media_size' => $size,
1050 'upscale_image' => true,
1051 'image_from_content' => ! $exclude_without_media, // whether to try to get image from content or not
1052 'no_gallery' => in_array( $preview_mode, array('carousel', 'carousel-modern') ),
1053 'ignore_media' => ! $show_media,
1054 'add_image_hw' => false, // whether add width and height attr or not
1055 'preloadable' => $preloadable,
1056 'preload_preview' => $preload_preview,
1057 'preload_bgcolor' => $preload_bgcolor,
1058 'image_sizes' => 'auto',
1059 'srcset_sizes' => 'auto',
1060 'ignore_formats' => $ignore_formats
1061 ),
1062 $content_width
1063 );
1064
1065 extract( $post_vars );
1066 $the_format = get_post_format( $post );
1067
1068 // add specific class to current classes for each column
1069 $post_classes = $has_attach && $show_media ? 'post column-entry' : 'post column-entry no-media';
1070
1071 // generate custom inline style base on feature colors for each post if the preview mode is table cell
1072 if ( 'grid-table' == $preview_mode ) {
1073
1074 $featured_color = '';
1075 $featured_image = '';
1076
1077 if( false !== strpos( $grid_table_hover, 'bgcolor' ) ){
1078 $featured_color = get_post_meta( $post->ID, 'auxin_featured_color_enabled', true ) ? get_post_meta( $post->ID, 'auxin_featured_color', true ) :
1079 auxin_get_option( 'post_single_featured_color' );
1080 }
1081 if( false !== strpos( $grid_table_hover, 'bgimage' ) ){
1082 $featured_image = auxin_get_the_attachment_url( $post, array( $column_media_width, $column_media_width ) );
1083 }
1084 // if grid table hover effect was only bgcolor
1085 if( 'bgcolor' == $grid_table_hover ){
1086 $columns_custom_styles .= $featured_color ? "\n.$base_class .aux-grid-table-layout > .post-{$post->ID}:hover { background-color:$featured_color; }" : '';
1087
1088 // if grid table hover effect was only bgimage
1089 } elseif( 'bgimage' == $grid_table_hover ){
1090 $columns_custom_styles .= $featured_image ? "\n.$base_class .aux-grid-table-layout > .post-{$post->ID}:hover { background-image:linear-gradient( rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4) ), url( $featured_image ); }" : '';
1091
1092 // if grid table hover effect was bgimage with bgcolor fallback
1093 } elseif( 'bgimage-bgcolor' == $grid_table_hover ){
1094 if( $featured_image ){
1095 $columns_custom_styles .= "\n.$base_class .aux-grid-table-layout > .post-{$post->ID}:hover { background-image:linear-gradient( rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4) ), url( $featured_image ); }" ;
1096 } elseif( $featured_color ){
1097 $columns_custom_styles .= "\n.$base_class .aux-grid-table-layout > .post-{$post->ID}:hover { background-color:$featured_color; }";
1098 }
1099 }
1100
1101 }
1102
1103 $template_part_file = 'flip' === $preview_mode ? 'theme-parts/entry/post-flip' : $template_part_file;
1104
1105 // Generate the markup by template parts
1106 if( has_action( $base_class . '-template-part' ) ){
1107 do_action( $base_class . '-template-part', $result, $post_vars, $item_class );
1108
1109 } else {
1110 printf( '<div class="%s post-%s">', esc_attr( $item_class ), esc_attr( $post->ID ) );
1111 include auxin_get_template_file( $template_part_file, '', $extra_template_path );
1112 echo '</div>';
1113 }
1114
1115 }
1116
1117
1118 // Add the custom inline style if available
1119 if ( $columns_custom_styles ) {
1120 wp_add_inline_style( 'auxin-inline-styles', $columns_custom_styles );
1121 }
1122
1123 if ( in_array( $preview_mode, array('carousel', 'carousel-modern') ) && 'arrows' == $carousel_navigation_control ) {
1124 if ( 'boxed' === $carousel_nav_control_skin ) :?>
1125 <div class="aux-carousel-controls">
1126 <div class="aux-next-arrow aux-arrow-nav aux-outline aux-hover-fill">
1127 <span class="aux-svg-arrow aux-small-right"></span>
1128 <span class="aux-hover-arrow aux-white aux-svg-arrow aux-small-right"></span>
1129 </div>
1130 <div class="aux-prev-arrow aux-arrow-nav aux-outline aux-hover-fill">
1131 <span class="aux-svg-arrow aux-small-left"></span>
1132 <span class="aux-hover-arrow aux-white aux-svg-arrow aux-small-left"></span>
1133 </div>
1134 </div>
1135 <?php else : ?>
1136 <div class="aux-carousel-controls">
1137 <div class="aux-next-arrow">
1138 <span class="aux-svg-arrow aux-l-right"></span>
1139 </div>
1140 <div class="aux-prev-arrow">
1141 <span class="aux-svg-arrow aux-l-left"></span>
1142
1143 </div>
1144 </div>
1145 <?php endif;
1146 }
1147
1148 if( ! $skip_wrappers ) {
1149 // End tag for aux-ajax-view wrapper
1150 echo '</div>';
1151 // Execute load more functionality
1152 if( ! in_array( $preview_mode, array('carousel', 'carousel-modern') ) && $wp_query->found_posts > $loadmore_per_page ) {
1153 echo auxin_get_load_more_controller( $loadmore_type );
1154 }
1155
1156 } else {
1157 // Get post counter in the query
1158 echo '<span class="aux-post-count hidden">'.esc_html( $wp_query->post_count ).'</span>';
1159 echo '<span class="aux-all-posts-count hidden">'.esc_html( $wp_query->found_posts ).'</span>';
1160
1161 }
1162
1163 }
1164
1165
1166 if( $reset_query ){
1167 wp_reset_postdata();
1168 }
1169
1170 // return false if no result found
1171 if( ! $have_posts ){
1172 ob_get_clean();
1173 return false;
1174 }
1175
1176 // widget footer ------------------------------
1177 echo wp_kses_post( $result['widget_footer'] );
1178
1179 return ob_get_clean();
1180 }
1181