Posted: September 27, 2016 at 10:32 pm
|
September 27, 2016 at 10:32 pm I liked the idea of showing who is coming to our event so I used [ESPRESSO_EVENT_ATTENDEES status=status=RPP show_gravatar=true] in a widget and edited content-espresso_event_attendees.php to remove ti I followed your instructions for editing the following:
|
Hi there, Currently you can not limit the query used to pull in the contacts for the above shortcode, you can skip stop outputting the details to the page after X amount but the query would have still pulled those details in. Other than building out your own query rather than using the shortcode I can’t see another way to limit the results, I’ll check with our developers to see if I’m missing anything. |
|
|
Thanks for the reply. You said, “you can skip stop outputting the details to the page after X amount but the query would have still pulled those details in.” How would I do that? |
You would use a loop within loop-espresso_event_attendees.php Before the foreach loop setup a counter, for example After the contact has been output within the foreach loop increment the counter with Then after that check if the counter is equal to the amount of contacts to display and if so, break the loop: Something like this should work: $i = 0; foreach( $contacts as $contact ) { EEH_Template::get_template_part( 'content', 'espresso_event_attendees', array( 'contact' => $contact, 'event' => $event, 'datetime' => $datetime, 'ticket' => $ticket, 'show_gravatar' => $show_gravatar ) ); $i++; if( $i >= 100 ) { break; } } |
|
|
I couldn’t get it to work…but on a more basic level, now the shortocode doesn’t work at all. I removed all my work and started from scratch and no matter what I do, it says “No Attendees Yet.” I have multiple registrations both approved and pending payment and no matter what combination if codes I use, nothing works. Thoughts? |
|
Ignore my last reply. I got it to work. And I got your loop to works. It works great. However, it doubles the output. So, on content-espresso_event_attendees.php, I’ve got the following code:
On loop-espresso_event_attendees.php, I’ve got the following code:
Here’s the output:
|
|
Hehehe. Never mind. I’ve got it all figured out. Have a good weekend! Thanks. |
Looks like you had the code to output the contact details twice within the file but its hard to tell with the code formatting on the forums. If posting code it much better to use something like http://pastebin.com/ and then including the URL here for us to view. Anyway, I’m glad you have it figured out 🙂 |
|
The support post ‘Attendee Gravatar Shortcode’ 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.