Recurring Event Category Custom Field - The Events Calendar

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:

  1. When I specify a featured image for the event, it does not show.
  2. 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):

<Set name=eventCatImage>
<Loop type=taxonomy_term taxonomy=tribe_events_cat post=current exclude="public" count=1>
  <If acf_image=inverse_category_image exists>
    <Field acf_image=inverse_category_image field=url />
  <Else />
    <Field acf_image=v4m_category_default_image field=url />
  </If>
</Loop>
</Set>

<If field=image exists>
  <p>featured image does exist</p>
  <Field image />
<Else />
  <p>featured image does not exist</p>
  <img src="{Get eventCatImage}" />
</If>

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.

Thanks in advance for any feedback!

Just an update based on my trials. This code is working, but far from ideal!

<Set name=bbeventcat>
  <Shortcode render=after>
  [wpbb post:terms_list taxonomy='tribe_events_cat' html_list='no' display='slug' separator=', ' limit='1' linked='no']
  </Shortcode>
</Set>

<Set name=eventCatImage>
<Loop type=taxonomy_term taxonomy=tribe_events_cat name="{Get bbeventcat}" exclude="public" count=1>
  <If acf_image=inverse_category_image exists>
    <Field acf_image=inverse_category_image field=url />
  <Else />
    <Field acf_image=v4m_category_default_image field=url />
  </If>
</Loop>
</Set>

<If field=image exists>
  <Field image />
<Else />
  <img src="{Get eventCatImage}" />
</If>

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.