WordPress.org

Forums

Event Organiser
[resolved] Displaying 'city', 'venue name' and 'end date' using 'Shortcode e (4 posts)

  1. Guillermo
    Member
    Posted 1 year ago #

    Hi everybody,

    I'm trying to add some extra information to show in the template "Shortcode event list". I copied the template into my theme, in order to make all modifications. The original template only shows the start date, and I want to add the city of the event, the name of the venue, and the end date of the event. I allready done with adding the name of the venue and the end date of the venue, but I'm still trying to add the city of the venue, without success.

    This is the code that I'm using to display the name of the venue and the end date :

    <li class="<?php echo esc_attr(implode(' ',$eo_event_classes)); ?>" >
    				<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_title(); ?></a><?php echo __(' | ', 'eventorganiser') . ' '.eo_get_venue_name(); ?><?php echo __(' | ', 'eventorganiser') . ' '.eo_get_the_start($format); ?> <?php echo __('-','eventorganiser') . ' '.eo_get_the_end($format); ?>

    My first idea was to add the city with something like this '<?php echo __('', 'eventorganiser') . ' '.eo_get_venue_address('city'); ?>' but it doesn't work. I suppose that the problem is that the function eo_get_venue_address displays an array.

    I'm reading about the way to transform arrays in wordpress, but maybe someone there know how to do this and can give me a hand.

    Regards !

    https://wordpress.org/plugins/event-organiser/

  2. Stephen Harris
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Guillermo,

    The plug-in codex contains details and examples for the various functions available. Specifically:

    Hope that helps!

  3. Guillermo
    Member
    Posted 1 year ago #

    Hello Stephen,

    I really like your plugin, so thank you for having done.

    I already read the codex documentation, and it was very helpful for me when adding "the end" and "the venue name", but I have not succeded yet in the case of "venue city". That's why I'm looking for some help.

    Both in "the end" and "venue name", codex documentation explains how to use the function in the loop. Instead, there is no explanation about how to use the function "eo_get_venue_address" in the loop. Is it possible to use it in the loop?

  4. Guillermo
    Member
    Posted 1 year ago #

    I read again the documentation and I find a solution, I hope that is the good one :

    So, the piece of code that I inserted in the loop in order to add the city of the venue is :
    <?php $address_details = eo_get_venue_address(); echo " | ".$address_details['city']; ?>

    :D

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Event Organiser
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic