Support

Home Forums Event Espresso Premium Hiding Expired Events From a Slider With EE4

Hiding Expired Events From a Slider With EE4

Posted: July 26, 2014 at 6:39 am

Viewing 4 reply threads


Mike Wiston

July 26, 2014 at 6:39 am

I am using Advanced Slider on my homepage to display the Event Espresso events (EE4), and I need to hide expired events from display in the slider. Any thoughts on how to accomplish this? It doesn’t matter if I use Advanced Slider or another plugin – the client simply wants a slider with clickable images, event title(s), and a short description on the homepage scrolling through upcoming events.

Any help would be appreciated.

I am using:

  • WP 3.9.1
  • EE4
  • Calendar Add-on

The site: http://node1.blmgweb.com/~soctshrm/

Thanks.


Dean

July 28, 2014 at 1:32 am

Hi,

It looks like the only way to do it in that plugin is to use the Exclude (optional) setting in the slider: screenshot http://take.ms/ODJrk


Mike Wiston

July 28, 2014 at 6:27 am

Thanks Dean – As mentioned, I don’t necessarily need to use that plugin, I just need to make a slider work displaying active events (not expired events) for my client.

The optional Exclude setting in Advanced Slider doesn’t seem to be a valid solution, as the client would need to manually exclude events on an ongoing basis.

Any other thoughts or suggestions?


Josh

  • Support Staff

July 29, 2014 at 12:37 am

Hi Mike,

If you open up advanced-post-slider.php and look for where it starts the loop, you can modify the loop a bit so events that ended before today will not be included in the output. Some example code follows:

have_posts()) : $the_query->the_post();  
    $myslidepost = get_post();
    $right_now = date('Y-m-d H:s:i');

    if($template == 'one' && $myslidepost->DTT_EVT_end > $right_now):
	?>


Mike Wiston

July 29, 2014 at 3:40 am

Josh – you are a lifesaver. Thanks for the help.

Viewing 4 reply threads

The support post ‘Hiding Expired Events From a Slider With EE4’ 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