Posted: April 1, 2015 at 8:00 am
|
Is there anyway to filter the event list to show only events with spaces available? |
Hi, there isn’t an built-in option to show events that have spaces available. This would require custom coding. There are some sort options, however sort by pricing isn’t available. These are: id https://eventespresso.com/wiki/shortcodes-template-variables/#event-list — |
|
|
I’m trying with custom coding, but can never quite get it working. Is it possible with the standard wp_query or does it require an SQL query statement? |
Hi, a team member shared some sample code on making this change to the event_list.php file here: https://eventespresso.com/topic/event-table-sorting-by-price/#post-69232 — |
|
|
Hi, That sample code just keeps throwing up ‘No events available…’ |
|
Hi, You can use some existing code from the event_list_display.php and add it with a slight tweak to the event_list.php file to stop displaying event with no available spaces. In the event_list.php at about line 326 you can add this:
Here’s a screenshot of the code: http://take.ms/GXpnx Here’s a general guide on customising templates in EE3 – https://eventespresso.com/wiki/put-custom-templates/ |
|
Hi, thanks for that. It kind of works… So by the time there may be only a couple of events with spaces left, I could end up with 4 blank pages before I get to the page with an available workshop on it. |
|
Yeah, that’s the flaw with this system. Other than that you’re going to have to edit the SQL query or loop through the $events array after the SQL query spits it out and filter that directly. |
|
Ah… |
The support post ‘EE3 Sorting and Filtering’ 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.