Support

Home Forums Event Espresso Premium Expired Events showing up in Slider Revolution

Expired Events showing up in Slider Revolution

Posted: October 18, 2017 at 9:22 am

Viewing 11 reply threads


compassmktg

October 18, 2017 at 9:22 am

Does anyone have any code we can use in CSS or other whereby we could configure the expired events top drop off slider revolution? Right now we have no problems with the events themselves coming off the calendar but hoping there is an automated way to have them drop off revolution slider at the same time. Right now, not sure of any way to get them to stop appearing but to trash expired events which we’d prefer NOT to do. Please advise! Any help would be most appreciate!!


Josh

  • Support Staff

October 18, 2017 at 2:55 pm

Hi there,

The could could actually be PHP code and it would modify the query that Slider Revolution uses to query the event posts. Does the Slider Revolution plugin have documentation that shows how to modify the query?


compassmktg

October 18, 2017 at 3:36 pm

Hi, Josh. Well there is documentation for slider revolution but I did not see anything that enables me to modify the query. I only found a place to add custom Javascript. Unfortunately I do not get premium support directly from them because I have use of it through Themeco Pro. I just wondered if anyone had thought about this. I mean it’s absolutely awesome that the expired events come off the calendar. And I LOVE how Espresso will automatically display events in the slider. Just not sure how we can get it to come off the slider when it expires. I have a WHOLE lotta events in “trash” right now just to get them off the slider hahaha. Here is the link to the documentation: maybe I’m just knowing what to look for? https://www.themepunch.com/revslider-doc/slider-revolution-documentation/ Any help would be greatly appreciated 🙂 Thanks!!


Josh

  • Support Staff

October 19, 2017 at 12:12 pm

Hi there,

I don’t think it’s Event Espresso that does anything to add events to the slider. What happens is Event Espresso registers a custom post type for events, and Slider Revolution can take those custom post types and display them.

The Slider Revolution documentation does have some information that shows how to modify the query. Here’s a link to their documentation:

https://www.themepunch.com/faq/advanced-additional-parameters/


Josh

  • Support Staff

October 19, 2017 at 1:04 pm

Oh, that documentation is actually for a different plugin.


Josh

  • Support Staff

October 19, 2017 at 2:10 pm

Here’s a gist that has some PHP code that will remove any past events from the Revolution slider:

https://gist.github.com/joshfeck/ffb55bbe7bf123c72cfeac729cc99773

You can add the above to a functions plugin or into your WordPress theme’s functions.php file.


compassmktg

October 20, 2017 at 8:07 am

Just wanted to say THANK YOU JOSH. I will look at putting that code in! I thought I responded to this yesterday but looks like my comment never got published. Great tech support here and much appreciate…


Josh

  • Support Staff

October 20, 2017 at 1:11 pm

You’re welcome.


txhomedecor

October 27, 2017 at 12:04 pm

Josh,

Ironically I use the Essential Grid which you originally posted above by accident and am trying to use https://www.themepunch.com/faq/advanced-additional-parameters/

However, when I add the above to functions.php, the grid just disappears and won’t display at all. I was wondering if its due to the field names which event espresso exposes that is causing the issue. Are the below fields correct? I’ve been searching for the answer for some time with no luck.

function eg_mod_query($query, $grid_id){

// show only upcoming events in the future
if($grid_id == 36){

$query[‘meta_query’] = array( ‘key’ => ‘_start_ts’, ‘value’ => current_time(‘timestamp’), ‘compare’ => ‘>=’, ‘type’=>’numeric’ );
$query[‘meta_key’] = ‘_start_ts’;
$query[‘meta_value’] = current_time(‘timestamp’);
$query[‘meta_value_num’] = current_time(‘timestamp’);
$query[‘meta_compare’] = ‘>=’;

}
return $query;
}

Thanks.


Josh

  • Support Staff

October 27, 2017 at 12:18 pm

Those fields aren’t actually correct. Event Espresso doesn’t use the post meta to store datetimes. The code from the gist shows the database fields Event Espresso actually uses.


txhomedecor

October 27, 2017 at 12:37 pm

Thanks Josh. By chance is there a listing of the database fields for Event Espresso in the Documentation? I was looking for that to check the code above which you confirmed is incorrect.


Josh

  • Support Staff

October 27, 2017 at 12:44 pm

You can look in your database and every table that has a table name starting with _esp_ is an Event Espresso table.

Viewing 11 reply threads

The support post ‘Expired Events showing up in Slider Revolution’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso