Support

Home Forums Event Espresso Premium editing Upcoming Events widget

editing Upcoming Events widget

Posted: March 17, 2013 at 1:32 am

Viewing 3 reply threads


srushton

March 17, 2013 at 1:32 am

HI there,
I’m trying to customize the output of the Upcoming Events widget. Currently it displays:
Event Title – Event Date
per event.

I’m trying to get it so that it displays:
Event Title – Event Date – Event Start Time
Number of Registrants / Registration Limit
per event

I understand that this means editing widget.php in plugins/event-espresso/templates and I also understand that the shortcode I’m likely trying to add is the [ATTENDEE_NUMBERS] but I’m not sure which line or where to add this to the widget.php file.

In addition to adding the attendee info, I’m also interested in adding the start time to the list of event title.

Hopefully what I’m trying to accomplish is clear; any help gratefully appreciated!


Dean

March 18, 2013 at 3:33 am

Hi,

This should get you started.

In the widget.php around line 129 you will see

<p><a href="<?php echo $registration_url; ? rel="nofollow">"><?php echo stripslashes_deep($event->event_name) ?> - <?php echo event_date_display($event->start_date) ?></a>

If you change it to the following it will add in what you need, you will just need to format it for your needs.

<p><a href="<?php echo $registration_url; ? rel="nofollow">"><?php echo stripslashes_deep($event->event_name) ?> - <?php echo event_date_display($event->start_date) ?> - <?php echo event_date_display($event->start_time, get_option('time_format')) ?> - <?php echo do_shortcode('[ATTENDEE_NUMBERS event_id="'.$event->id.'" type="num_attendees_slash_reg_limit"]'); ?></a>


srushton

March 18, 2013 at 12:00 pm

Thank you so much!! I had pretty much figured out where to put the php shortcode calls but had the variable wrong. I was getting the php examples from:
https://eventespresso.com/forums/2010/10/post-type-variables-and-shortcodes/

and they all list .$event_id (which doesn’t appear to work) instead of your example of .$event->id. which does.

Thanks again for the help – this definitely gets me more than on the right track!


Dean

March 19, 2013 at 1:37 am

No problem glad you got it working.

As an aside, that documentation is 2-3 years old and variables/code changes over time so thats why the variables there werent working now.

Viewing 3 reply threads

The support post ‘editing Upcoming Events widget’ 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