Support

Home Forums Event Espresso Premium Displaying City widget list

Displaying City widget list

Posted: June 9, 2014 at 9:16 am


Daniele Pavinato

June 9, 2014 at 9:16 am

Hi,

I need to display the City or Venue inside the widget events list.
How can I do it?


Dean

June 10, 2014 at 12:08 am

Hi,

You would need to edit the widget.php template file.

Personally I would add something like the following into the list item at around line 132

<?php echo do_shortcode('[ESPRESSO_VENUE event_id="' . $event->id . '" show_image="false" show_description="false" show_address="false" show_additional_details="false" show_google_map_link="false" show_map_image="false" outside_wrapper="span" title_wrapper="span" ]'); ?>

All this does is show the venue name via shortcode.


Daniele Pavinato

June 10, 2014 at 6:58 am

Is however possible to extract only the city?
Maybe using get_post_meta($post->ID, 'event_city');?


Dean

June 11, 2014 at 2:08 am

Hi,

In EE3, if you are using the Venue Manager, then the venue details are not held in the meta, so your above example won’t work.

If it’s via the Venue Manager, then the only ways I could think of doing it would be to either do a couple of SQL queries to find the venue ID and then get then venue data needed, or to pull the address in via the shortcode then explode() the value and get the data that way.

The SQL option will probably be the easier option.


Daniele Pavinato

June 11, 2014 at 6:04 am

Can you make me an example with the SQL code?


Daniele Pavinato

June 11, 2014 at 6:17 am

I have wrote a new code line into the shortcode.php file. How can I avoid to loose the custom code if I decide to update the plugin? What is the suggested way to move this modification into the custom_functions.php file?


Daniele Pavinato

June 11, 2014 at 6:21 am

Solved!


Dean

June 11, 2014 at 6:45 am

Glad to hear you got it solved!


Jimmy Cho

June 22, 2014 at 9:41 am

Daniele – Any chance you can share what you did for people that are looking for this, or something similar. I’m trying to show the next upcoming event on our homepage, but need it to include the venue, which I can’t seem to do (at least just the city/state)

Thanks! Maybe your code will help me.

The support post ‘Displaying City widget list’ 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