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