Support

Home Forums Event Espresso Premium How to display latest event? [SINGLEEVENT single_event_id=" #latest# "]

How to display latest event? [SINGLEEVENT single_event_id=" #latest# "]

Posted: October 12, 2012 at 9:58 am


Jan van der Meijde

October 12, 2012 at 9:58 am

I’m looking for a way to show the single latest event including the registration form.

Preferably something I can use in a template like:

Thnx!


Dean

October 15, 2012 at 12:10 am

Hi,

Rather than using the Single shortcode which is limited, why not use the event list one?

[EVENT_LIST limit=1 order_by=date(start_date),id sort=DESC] 

will show the latest but only single event. It doesnt show a registration form but if you are amending a template it should be possible to get the registration form to display.


Jan van der Meijde

October 19, 2012 at 4:42 am

Hi Dean,

I would use the event_list template, but I’m already using it somewhere else.

Is there no other way to simply display the latest event?

thnx!


Dean

October 19, 2012 at 5:43 am

Hi Jan,

To my knowledge that is the best way set a single event that will update to always be the latest event.

[SINGLEEVENT] can be used but you would have to keep manually updating it which isnt good.

The only other option would be to custom code a function/shortcode to do what you want – perhaps combining the [EVENT_LIST] and the [ESPRESSO_REG_PAGE] short codes.


Jan van der Meijde

October 19, 2012 at 5:52 am

Hi Dean,

thanx for the reply.

I have solved the problem by manually selecting the latest event_identifier from the mysql database and combining the value with the {SINGLEEVENT} shortcode.

I’m nog much of a programmer but I think this will be a quite stable solution.


Jan van der Meijde

October 19, 2012 at 5:53 am

I see the code is not being displayed in my last post. How can I post my code?

thnx.


Dean

October 19, 2012 at 6:03 am

Hi Jan,

If you are struggling to post code here (it is stripped for non admins) please use a service like http://pastebin.com/


Jan van der Meijde

October 19, 2012 at 6:07 am

Here is the link to the code

The support post ‘How to display latest event? [SINGLEEVENT single_event_id=" #latest# "]’ 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.

Event Espresso