Posted: February 22, 2018 at 7:07 pm
|
Hey guys, Is there a way to use shortcode to display the remaining datetimes? Currently I’m using this: https://gist.github.com/joshfeck/777cc126964a25c15962f2c14aa3eb82 But that’s kind of hidden under the ticket selector and doesn’t break down the real availability (example – afternoon classes 3 left, evening 8 left). This is what I’d like: https://www.dropbox.com/s/f8op3cemswklccn/Screenshot%202018-02-22%2018.03.20.png?dl=0 Of course, I expect that I would have to identify a datetime it needs to pull the data from. Failing that, is there a way to display the Is this possible? Thanks, Derek |
Hi Derek, Theres another example that breaks down each datetime here: https://gist.github.com/Pebblo/3d019689d6c51a302eb95bbd3174b91e#file-example2-php That is displayed just before the ticket selector, rather than below it. Converting the Joshes example into a shortcode can be done but it’ll need more than just converting into a shortcode to do what you are requesting. |
|
Or move the location: |
|
|
OK, thanks guys. What I meant by converting to shortcode was doing just that, not using that as a way to do what I was trying to achieve as a first choice. So could this code JOsh provided: be converted to shortcode? If I ‘m going to go this way, I need to control which events it is showed in, so was going to use shortcode for that. Some events have as many as 18 datetimes, so it doesn’t look good to display all of those in 1 big list. I would prefer to use the function on events with just 1 datetime for the time being. Thanks, Derek |
Sorry but I’m not sure I follow this. You want it converting to a shortcode to not do what you are asking as a first choice?
Yes the code you linked to can be converted to a shortcode: https://gist.github.com/Pebblo/f07d5515180b363864160d90ca41ec0f Use that within an event to output the same as it does already, you can also add an event_id=X attribute to the shortcode if its for a specific event in a post/page (so not an EE event post). However note that snippets and examples we provide here are unsupported. |
|
|
Excellent, thanks! |
You’re most welcome 🙂 |
|
The support post ‘Remaining Datetimes’ 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.