Posted: September 10, 2014 at 5:27 am
|
EE3 all add ons Hi Guys, I’m trying to find out if some shortcode is still applicable and whether its in the right location. http://www.getcookingedmonton.com/cooking-classes/event-registration/?ee=186 Can the shortcode also be applied for the event list? – http://www.getcookingedmonton.com/class-list/ Currently it is only showing ‘0’ attendees if the event is full. I have gone through this Doc, but I believe this not working correctly – https://eventespresso.com/wiki/how-to-customize-your-available-spaces-text/# Thanks. |
|
Hi Ben, The shortcodes can be added to any template file via the do_shortcode() function – http://codex.wordpress.org/Function_Reference/do_shortcode What shortcode are you using exactly? And where? That document isn’t out of date per se, it has it’s uses. The ATTENDEE_NUMBERS will show numbers. But if you wanted to show a worded respons (e.g. Spaces still available, or running out soon) then that document could be used. You could also use the ATTENDEE_NUMBERS shortcode in a similar way by not echoing it but adding the result to a variable and comparing that value. |
|
Thanks Dean, I’m using – How can I also get it showing correctly in the event list also with a message. This is the event_list_display.php in the templates folder – http://screencast.com/t/jIwwOsm6 Thanks |
Hi, Please see the template code here: https://eventespresso.com/wiki/shortcodes-template-variables/#attendee-numbers — |
|
|
Thanks Lorenzo, I’m aware of that. What I’m asking is where it needs to be placed? There are 2 different event views as described above. Is there a template for both of them? |
September 10, 2014 at 10:42 am Yes there are two different template files. Event list uses event_list.php and event_list_display.php. The registration page uses registration_page.php and registration_page_display.php The files without _display are used to pull in all the information and declared variables for use. The _display files are used to output the sections using that info/variables. |
|
|
Thanks Tony, This is the current code – = $reg_limit) { ?>
|
Hi Ben, Please explain what you mean by more substantial code? Along with that, it looks like you have an extra closing brace now that you’ve removed the else statement. |
|
|
Thanks Josh, The first set of code is actual the default code in the event_list_display.php, where as the 2nd customise code seems to be less detailed. The goal is to have the attendee numbers displayed in each event, as well as the event list. Thanks. |
The reason the Available spaces is not showing on the event list (the original code) is because you have ‘Display Registration Form’ set to No. You can see in that code it checks the attendee numbers: if ($num_attendees >= $reg_limit) { If $num_attendees is greater than or equal to the reg limit (the event is sold out or oversold) then display no spaces. Then you have } else { so if the $num_attendee is not greater than or equal to (there must be spaces available, do this: if ($display_reg_form == 'Y' && $externalURL == '') { ?> |
|
|
September 11, 2014 at 10:18 am That’s great Josh, Works great on the Event List, thanks! Took me a bit of time to look through the registration_page_display, but I’ve got it working in there now also. Thanks for your help! |
September 11, 2014 at 10:26 am No Problem Ben, Glad you got it working 🙂 I’ll mark this thread resolved, if you do have any other questions feel free to start another. Tony |
|
The support post ‘Show Attendee Numbers’ 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.