• Hi all,

    I would like to change two things in the display of the widget:
    – when an event doesn’t have a “Venue”, the widget shows “My Event Title at” and then, nothing. The at should be written only if the event has a venue.
    – when an event has the same Start Date as End Date, the widget displays for example “6th November 2016 – 6th November 2016”. It would be better to display “6th November 2016”, without repetition.

    I’ve done 2 changes in widget-upcoming-events.php to display the widget’s text as I want, but is there another way to do this?

    Here are the 2 if conditions I have added in the code:
    for the venue:

    <?php if ( ! empty($event_venue) ) { ?>
    <span class="event_venue">at <?php echo $event_venue; ?></span>
    <?php } ?>

    and for the dates:

    <time class="sis_event_date"><?php echo date_i18n( get_option( 'date_format' ), $event_start_date ); ?>
    <?php if ( $event_start_date != $event_end_date ) {
    echo '&ndash; ' . date_i18n( get_option( 'date_format' ), $event_end_date );
    } ?>
    </time>
  • The topic ‘Widget: Events without Venue / Events with Start Date = End Date’ is closed to new replies.