Posted: August 17, 2023 at 5:21 am
Hello, Events that have a status of ‘Sold out’ are not displaying on my site, and we need them to be visible. I’m using a plug-in called Ajax Load More (ALM) to display events, and you’ve previously offered help in ensuring that expired events were hidden, by generating a comma-separated list of not-expired event IDs. (See previous forum topic) I think the cause of the ‘Sold Out’ problem might be that the ALM plug-in is only displaying posts with a status of ‘Published’, and doesn’t recognise the status of ‘Sold Out’. The ID for the sold-out events are being included in the comma-separated list, but the ALM plug-in is not displaying them Can you suggest a workaround for this? (e.g. reclassify all Sold Out events as Published…?? or anything else?). Thanks for any help you can give |
|
Hi there, Does ALM have filters for its query args? |
|
Thanks for your reply Tony. I’m not totally sure whether ALM offers what you mentioned, but I think it does (e.g. https://connekthq.com/plugins/ajax-load-more/docs/add-ons/filters/hooks/ – is this the sort of thing you mean?). By default, the ALM plug-in only appears to display posts with a status of ‘published’ or ‘inherit’ I appreciate you can’t support ALM. If you’re not able to offer a workaround, I’d be happy to get in touch with them directly to see if they can help. If they can’t offer any help, can I ask whether sold out events can just keep their status of ‘published’? I figure that would at least get the events to display… but I’m not sure if (a) this is possible or (b) if it would cause other problems. |
|
The short and sweet answer to this is no. I’d also recommend against going down this route, for the sake of being able to pass a post status to a query your shoehorning Event Espresso functions around. But let’s see, this may be possible. Where are you hooking in to pass the event IDs from the previous post? |
|
This reply has been marked as private. | |
It does, your passing the ID’s as a shortcode parameter and not through a filter so it doesn’t help for what I was looking for. Hmm, so it doesn’t have a way for you to pass the post status, you could filter pre_get_posts but that’s going to run everywhere so then have to do a bunch of checks… ALM has a filter for the query_args used in the query: https://connekthq.com/plugins/ajax-load-more/docs/filter-hooks/#alm_query_args
You have
Add that to a custom functions plugin, we have some docs on creating on here: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ Note the above is untested just based on the docs. |
|
Hi Tony, Thanks – I really appreciate your continued help with this. Unfortunately the code you suggested didn’t work – the sold_out events continued to be hidden from view. At this point, should I contact ALM support and see if they can help with displaying posts with a post_status of sold_out? |
|
:facepalm: It didn’t work because there is a typo in my code! Replace the snippet I gave you above with this….
My original snippet used A couple of bits to note, ALM has a post_status shortcode parameter, which can be set to “any” (
Just to show this working: https://monosnap.com/file/bjo1O1liXFeHO2ZyYnYEjDjh7ZYHZY With this shortcode: |
|
The support post ‘Sold out events not showing on main event listing’ 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.