Support

Home Forums Event Espresso Premium LISTATTENDEES shortcode is not working with event identifier

LISTATTENDEES shortcode is not working with event identifier

Posted: September 11, 2012 at 11:46 am


amunns

September 11, 2012 at 11:46 am

This shortcode is not working

echo do_shortcode(‘[LISTATTENDEES event_identifier=”‘.$event_identifier.'”]’);

it simply prints all of the events with attendees instead of just the current event. I also tried with $event_id but it doesn’t work. It either prints nothing or everything even though I am certain there are events attendees for the given event.


Chris

September 11, 2012 at 2:59 pm

The event identifier is the big long thing under the event title. its next to the short-code button and you cant copy and paste it very easy. Just get the ID out of the shortcode.

[SINGLEEVENT single_event_id=”wet-t-shirt-xxx-9-692ec2d420e69″]

Its that giant ID lol. It works, but wasn’t what I wanted to see come out for non-admins. I was trying to get a simple list when i tired it, not the entire event description and images.


amunns

September 11, 2012 at 4:00 pm

I’m looking to use a variable as shown in other forum threads here…but thanks for trying.


Chris

September 11, 2012 at 7:48 pm

What vari, the event_identifier=””?


Dean

September 12, 2012 at 12:20 am

Hello Amunns,

Try

<?php echo do_shortcode('[LISTATTENDEES event_identifier="'.$event_identifier.'"]'); ?>


amunns

September 12, 2012 at 10:21 am

Dean, I don’t follow how your snippet is different from mine. I already tried that and it returns all of the events when I’m on the event registration page.


Seth Shoultes

  • Support Staff

September 12, 2012 at 11:19 am

@amunns where are you trying to use this code? In a theme file or an Event Espresso template file? Is the $event_identifier variable declared somewhere in the file? Have you tried echoing the $event_identifier variable to the page?


Dean

September 13, 2012 at 1:41 am

Hey,

Yeah, didnt even realise, I must have took it, played around with it and ended up changing it back!

The code works, I had it in the registration_page_display.php, but you need to be careful where it is placed as otherwise it may not show up.

As Seth said, really it depends on where it is going, I should of asked that, so which file are you trying to use it in?


amunns

September 13, 2012 at 10:00 am

I have placed it in the registration_page.php AFTER the var is defined on line 96

$event_identifier = $data->event->event_identifier;

I have placed the code mentioned ex:
echo do_shortcode(‘[LISTATTENDEES event_identifier=”‘.$event_identifier.'”]’);

on line 293 where the inclusion of registration_page_display.php is located.


Dean

September 13, 2012 at 11:19 pm

Adding it the the registration_page_display.php allows more control over placement in my opinion, for eg I placed it around line 179 and it put the list after the price.


amunns

September 14, 2012 at 10:34 am

That’s not the point. I see it on the page template and can change the placement later if need be. The problem is that the $event_identifier variable is displaying ALL the events and not the current event. This is problematic when you have hundreds of events.


Chris Reynolds

  • Support Staff

September 18, 2012 at 12:55 pm

I know the shortcode documentation says to use the event identifier but looking at the code (lines 114-223 of /includes/shortcodes.php) tells me that it might actually be using the event ID not the event identifier so try this:

 <?php echo do_shortcode(‘[LISTATTENDEES event_identifier="'.$event_id.'"]‘) ?>


Chris Reynolds

  • Support Staff

September 18, 2012 at 12:57 pm

That said, if you’re using it on the registration page anyway, just using the shortcode in the event description will display an attendee list for just that event by default.


amunns

September 18, 2012 at 12:58 pm

I also tried that. If you read the original post I mention it up there, but it does not work using $event_id either. Thanks for the tip though. Any other suggestions?


amunns

September 18, 2012 at 12:59 pm

hmmm okay I’ll try that in the event description


Gen Gelinas

September 18, 2012 at 8:04 pm

AMunns, any success? I am trying to achieve the same result you are with the template files and the same problem occurs (attendees for all events are shown instead of just the one we need).

When I try using the [listattendees] shortcode in the event description, it breaks the calendar view with a memory allocation error. [sigh]


Gen Gelinas

September 18, 2012 at 9:13 pm

AMunns, I finally managed to make it work. In registration_page_display.php , at line no. 247, I used this code

enter image description here

The support post ‘LISTATTENDEES shortcode is not working with event identifier’ 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