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