Support

Home Forums Event Espresso Premium How to Exclude Expired Events on Category Pages

How to Exclude Expired Events on Category Pages

Posted: April 22, 2014 at 4:16 pm

Viewing 4 reply threads


Marcelle

April 22, 2014 at 4:16 pm

Hi,

I wonder how to exclude Expired Events on Category pages w/o shortcode?

Thanks


Tony

  • Support Staff

April 23, 2014 at 4:34 am

Hi Steve,

Is this EE3 or EE4?

Can you explain a little more of how your pages are setup please?


Marcelle

April 23, 2014 at 3:34 pm

This is EE4,
I have a template taxonomy-espresso_event_categories.php in my Child Theme for Displaying All Events Categories.
Just need a hook or filter to by bypass Expired Events on may be pre_get_post hook?

Please let me know!

Thanks


Marcelle

April 25, 2014 at 3:05 pm

You can take a look at wbcompanies.com – I’d basically like to not have old events showing on a category page – http://wbcompanies.com/event-category/ielnl/

If it’s already passed, I would like to suppress it from showing on this page since it no longer serves a purpose to users.


Josh

  • Support Staff

April 25, 2014 at 10:45 pm

Hi Steve,

You could try a custom query like this:

<?php 
$args = array( 'posts_per_page' => 10, 'show_expired' => FALSE );
$loop = new EE_Event_List_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
	get_template_part( 'content', 'espresso_events' );
endwhile; 
?>
Viewing 4 reply threads

The support post ‘How to Exclude Expired Events on Category Pages’ 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