Hopefully someone can help. I’ve been looking for a way to display the event category on the event list page (yes, I’m creating a custom archive template). I keep seeing this code which should do what I want:
`do_shortcode(‘[CATEGORY_NAME event_id=”‘.$event_id.'”]’)
I’m substituting event_id for post->ID since I’m within a loop but it’s just returning the text of the shortcode, eg: [CATEGORY_NAME EVENT_ID=”310″] actually appears on screen in the place where I want the category name to display.
The ID is correct – but the shortcode isn’t working. I’m assuming this is a difference between EE3 and 4.
EE4 doesn’t actually use shortcodes to show this type of data because EE4 events are custom post types. So you can use native WordPress functions instead. I can point you to these references:
Perfect – thank you. I’ve gotten it working using get_the_terms 🙂
Viewing 2 reply threads
The support post ‘EE4 display event category in loop’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.