![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
Tagged: Calender, Entry, event, postslider, slider
-
AuthorPosts
-
July 18, 2018 at 6:28 pm #987134
Hi, i use the enfold entry slider with the categorie from the event calender plugins.
It works fine.The problem:
its sorted by the latest entry. ex: December, november, september, august, juli, juni etc
It would be cool if sorted by: juni, juli, august, september etc..It is possible to change?
Best
ChrisJuly 19, 2018 at 2:51 pm #987425Hey Kingsfield,
Thank you for using Enfold.
Where can we see the categories? Please provide a link to the actual page so that we could inspect it.
Best regards,
IsmaelJuly 19, 2018 at 3:36 pm #987450Hi Ismael, thanks for your quick reply.
Actually the website is in maintenance mode so I can´t show. But its okay.
Come back if I have finish the website and react this thread.Best regards
July 20, 2018 at 2:06 pm #987835Hi,
Alright. We’ll keep the thread open. Let us know once the site is ready. :)
Best regards,
IsmaelAugust 1, 2018 at 12:04 am #992128Hi Ismael.
Sorry for delay. Litte vacation :)First of all the website is not ready yet.
What i did:
I copy this code:add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
to my function.php and i have created a folder called /shortcodes. After that i copy all files from the original theme /enfold/config-templatebuilder/avia-shortcodes/postslider to my new folder.
Than I changed this: $order = ‘DESC’; to $order = ‘ASC’; in /postslider.php | row 761 (DESC = Descending / ASC = Ascending)
Works fantastic.
Currently I have the problem that all events are displayed. The past, too. (Dates are correct) Only the upcoming events should be displayedAn the second:
I would like to have the date above the slide-image.
I found this in /postslider.php:$output .= '<footer class="entry-footer">'; if( !empty($meta) ) $output .= $meta; $output .= '</footer>';
But where i have to copy it above the silde-image?
best regards
Chris-
This reply was modified 6 years, 1 month ago by
Kingsfield.
August 2, 2018 at 5:27 am #992681Hi,
Thanks for the update.
You can try this filter to fetch and only display the upcoming events.
add_filter('avia_post_slide_query', 'avia_post_slide_query_mod', 10, 2); function avia_post_slide_query_mod( $query, $params ) { $eventquery = array('paged'=> false, 'eventDisplay' => 'list'); $upcoming = Tribe__Events__Query::getEvents( $eventquery, true); $include = array(); foreach($upcoming->posts as $key => $event) { $include[] = $event->ID; } $query['tax_query'] = array(); $query['post__in'] = $include; return $query; }
You may need to add a conditional function to exclude other posts sliders.
Best regards,
IsmaelAugust 2, 2018 at 5:50 pm #992946Hi Ismael, thanks for your quick reply.
I enter the code above in my functions.php. It works partly.
Now I have the upcoming events, but the created date is displayed. Not the date of the event.
And secondly all categories are displayed, although I eg. choose only one category.Strange! :)
best regards
ChrisAugust 3, 2018 at 12:28 pm #993223Hi,
Thanks for the update.
That was actually intended. The filter will just query every upcoming events regardless of the category. Please post the login details in the private field so that we can test the filter.
Best regards,
IsmaelAugust 3, 2018 at 9:33 pm #993358Hi Ismael,
in the private section you will find the login details
Best regards
ChrisAugust 6, 2018 at 6:49 am #993808Hi,
Thanks for the update.
I adjusted the filter query a bit and it’s now displaying events from the specified categories.
You need to edit the config-templatebuilder > avia-shortcodes > postslider > postslider.php file around line 629 to display the start date. It is currently displaying the published date, which is how it’s supposed to work by default.
$meta .= "<time class='slide-meta-time updated' $markup>" .get_the_time(get_option('date_format'), $the_id)."</time>";
Replace the default date function with “tribe_get_start_date”.
Best regards,
IsmaelAugust 7, 2018 at 8:05 am #994259Hi Ismael, thanks.
I´ll check today and let you know.
Best regards
ChrisAugust 8, 2018 at 1:40 am #994647August 8, 2018 at 9:06 am #994742Hi Ismael,
sorry for delay.Hi add this to postslider.php:
.tribe_get_start_date( $entry->ID, false, 'F j, Y' )
Works fine. The event start dates are displayedCurrently, the problem is that only display one categorie if i choose more than one on the startpage. Strange ! :)
best regards
ChrisAugust 9, 2018 at 8:25 am #995288Hi,
Thanks for the update.
I adjusted the filter a bit — it should work as expected now. I had to convert the category strings to an array.
Best regards,
IsmaelAugust 9, 2018 at 11:03 am #995369Hi Ismael, thanks. Works perfectly. :)
If it´s okay I would like to post the result for other creatives down belowbest regards
ChrisAugust 9, 2018 at 2:51 pm #995502Hi Kingsfield,
Glad Ismael could help :)
Here is the function for other creatives :
/* * add a upcoming event filte to postslider */ add_filter('avia_post_slide_query', 'avia_post_slide_query_mod', 10, 2); function avia_post_slide_query_mod( $query, $params ) { $eventquery = array('paged'=> false, 'eventDisplay' => 'list', 'tax_query'=> array( array( 'taxonomy' => 'tribe_events_cat', 'field' => 'term_id', 'terms' => explode(',', $params['categories']) ) )); $upcoming = Tribe__Events__Query::getEvents( $eventquery, true); $include = array(); foreach($upcoming->posts as $key => $event) { $include[] = $event->ID; } $query['tax_query'] = array(); $query['post__in'] = $include; return $query; }
Best regards,
VictoriaAugust 9, 2018 at 10:56 pm #995764Thanks Ismael & Victoria.
Here my tutorial to use the enfold postslider with the plugin “Event Calender”
1. Copy this code to your function.php in your child theme (important)
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
2. Copy this code to your function in your child theme
<?php /* * Add your own functions here. You can also copy some of the theme functions into this file. * WordPress will use those functions instead of the original functions then. */ /* * Enfold Avia Shortcode changes for child theme */ add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; } /* * add a upcoming event filte to postslider */ add_filter('avia_post_slide_query', 'avia_post_slide_query_mod', 10, 2); function avia_post_slide_query_mod( $query, $params ) { $eventquery = array('paged'=> false, 'eventDisplay' => 'list', 'tax_query'=> array( array( 'taxonomy' => 'tribe_events_cat', 'field' => 'term_id', 'terms' => explode(',', $params['categories']) ) )); $upcoming = Tribe__Events__Query::getEvents( $eventquery, true); $include = array(); foreach($upcoming->posts as $key => $event) { $include[] = $event->ID; } $query['tax_query'] = array(); $query['post__in'] = $include; return $query; }
3. Create a folder called /shortcodes (important) in your child theme. After that copy all files from the original theme /enfold/config-templatebuilder/avia-shortcodes/postslider to the folder /shortcodes
4. Than change this in file: postslider.php | row 761:
$order = ‘DESC’; to $order = ‘ASC’; (DESC = Descending / ASC = Ascending)5. In your postslider.php change this code | row 629 (This entry is to display the startdate from the event.)
$meta .= "<time class='slide-meta-time updated' $markup>" .get_the_time(get_option('date_format'), $the_id)."</time>";
in
$meta .= "<time class='slide-meta-time updated' $markup>" .tribe_get_start_date( $entry->ID, false, 'F j, Y' )."</time>";
This entry is to display the startdate from the event.Different display:
a .tribe_get_start_date( $entry->ID, false, ‘F j, Y’ ). Looks like this: November 11, 2018
b .tribe_get_start_date( $entry->ID, false, ‘F j, Y – g:i a’ ). Looks like this: November 11, 2018 – 9:00 am
c .tribe_get_start_date( $entry->ID ). Looks like this: .November 11 @ 9:00
Change the @ sign in the plugin options from event calender in what you like.Addional.
Limiting excerpt (if you want to limit the excerpt in postslider)
Add this code to your functions.phpadd_filter('avf_postgrid_excerpt_length','avia_change_excerpt_length',10,1); function avia_change_excerpt_length() { return 65; }
Change “return 65” to increase or reduce the excerpt. Example return 100;
Have fun.
Thanks Enfold team for helping me.
Best regards
Chris-
This reply was modified 6 years, 1 month ago by
Kingsfield.
August 10, 2018 at 9:05 am #995866Hi,
Awesome! Thanks for the tutorial! Looks good. :)
Please take a moment to review our theme and show your support https://themeforest.net/downloads
Don’t forget to bookmark Enfold Documentation for future reference.Thank you for using Enfold :)
Best regards,
Ismael -
This reply was modified 6 years, 1 month ago by
-
AuthorPosts
- You must be logged in to reply to this topic.