I’m having trouble accessing a custom field defined for the category of a recurring event using The Events Calendar. My code seems to work for a singular (non-recurring) event.
My approach is to check to define a variable, checking to see if the first event category assigned to the post has an image defined for the custom field ‘inverse_category_image’. If not, then the variable uses the image url for the image assigned to a different custom field, ‘v4m_category_default_image’.
The code then checks to see if the event has a featured image. If it does, the featured image is shown. If not, then the url from the initial variable is used.
For recurring events, what I’ve found is:
When I specify a featured image for the event, it does not show.
On page load, there is a noticeable delay before the broken image icon shows up for me in Safari. This makes me think that the code is looping through all instances of the recurring event.
Examples:
Recurring Event without featured image:
Recurring Event with a featured image:
Singular Event without a featured image (image from the category custom field shows up):
How do I access data about recurring events using Loops & Logic? I feel like there’s a ‘has post parent’ or ‘is recurring’ conditional that I’m missing.
I’m using Beaver Builder’s shortcode to get the taxonomy term for the recurring event. This seems to return the taxonomy term for the parent recurring event, not the individual instance, allowing me to access a custom field associated with the taxonomy term.
I’d love to know if there’s a way to not rely on the BB shortcode for this.
I’m not sure what the best solution here is, we’ll likely have to build an explicit integration with TEC to get everything working smoothly because they’re doing a lot of weird non-standard stuff behind the scenes that gets in the way. We had a working integration with them at one point but had to scrap it because they changed the structure of the plugin significantly a while back.