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