Show end times

This topic contains 2 replies, has 3 voices, and was last updated by  Stephen Harris 11 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7997

    Would like the event page to show the END times of events. This is pretty critical for most people who sign up for things in my experience, to know what the commitment is.

    AlphaSmith
    #8002

    This feature is already part of WP EO, you’ll just have to edit your theme’s templates a little to include the end function.

    See this codex page: http://codex.wp-event-organiser.com/function-eo_get_the_end.html

    Here’s an example of what you could do:

    <?php echo eo_get_the_start('H:i')." to ".eo_get_the_end('H:i'); ?>
    Dario
    #8004

    Hi Alison,

    Further to Dario’s post, the appropriate template is event-meta-event-single.php (if you want to display the event end date on the single event page). By default, the plug-in only displays a start date for non-recurring events, otherwise it lists all future (start) dates (and hides, all but 5).

    To display an the end date/time you can change (~line 56):

     <?php if( !eo_reoccurs() ){ ?>
            <!-- Single event -->
             <li><strong><?php _e('Start', 'eventorganiser') ;?>:</strong> <?php eo_the_start($date_format); ?> </li>
      <?php
      } ?>

    To

     <?php if( !eo_reoccurs() ){ ?>
            <!-- Single event -->
             <li><strong><?php _e('Start', 'eventorganiser') ;?>:</strong> <?php eo_the_start($date_format); ?> </li>
             <li><strong>End:</strong> <?php eo_the_end( $date_format ); ?> </li>
      <?php
      } ?>

    And for recurring events (~line 88)

     <li><strong><?php _e('Upcoming Dates','eventorganiser'); ?>:</strong>
          <ul id="eo-upcoming-dates">
              <?php while( $upcoming->have_posts() ): $upcoming->the_post(); ?>
                   <li> <?php eo_the_start($date_format) ?> </li>
              <?php endwhile; ?>
          </ul>
     </li>

    To

     <li><strong><?php _e('Upcoming Dates','eventorganiser'); ?>:</strong>
          <ul id="eo-upcoming-dates">
              <?php while( $upcoming->have_posts() ): $upcoming->the_post(); ?>
                   <li> <?php eo_the_start($date_format) ?> - <?php eo_the_end($date_format) ?></li>
              <?php endwhile; ?>
          </ul>
     </li>

    Of course you may wish to format date/time differently. If you need any more assistence on this, I’d be happy to help!

    Stephen Harris
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.