Posted: October 15, 2014 at 4:08 pm
Hi! I’m wanting to create a custom “featured event” callout on the main page, and i’ve sort of got it to work using advanced custom fields. The problem is, i’d like to make it easier. The callouts in question are under the slider here: https://www.jazzyyc.com/ Each element in the callout is generated on a page with it’s own custom fields. So a page_link field for the URL, a text field for the title, venue name, date and another page_link for the venue URL, and an image field for the image. I’m able to select the event from a dropdown, publish and then it pulls the event title and link using this code below:
My question is, how can I pull the event date/time from the event page? I know that it is done with the upcoming events widget, so i’m hoping I can do it this way as well. Bonus points if I can pull the venue/venue link from the page as well, however I don’t think it’s that simple (I can create a post object for the venue). Ideally, i’d like to select the event from the dropdown, and have the result look exactly how it is now on the front end. (or at the very least select the event and the venue). |
|
Hi Ty, There’s an example of how to get the event’s datetimes from the EE_Event object in the developer documentation here: http://developer.eventespresso.com/docs/ee-model-objects-and-custom-post-types/ |
|
Thanks Josh. I actually got the datetimes to work using the template tag :espresso_list_of_event_dates( $post->ID ); The problem I have was getting it to pull the venue from that event, using the template tag: espresso_venue_name(). None of the template tags for venue seemed to pull anything.
I’ll try looking at the documentation you’ve given me to see if I can find an answer. Thanks! |
|
Hi Ty, The espresso_venue_name() template tag is intended to be used in a venue view. You can use the venue() method in an event view though. For more info on how to do that, please see Example #1 in the reply in this related thread from earlier today: |
|
The support post ‘EE4 – Post Object with Advanced Custom Fields to pull event time and date?’ 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.