Change time format on single event page

WordPress Event Management, Calendars & Registration Forums General Question Change time format on single event page

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 6 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #28063

    Hey there,

    I already solved my initial problem (see below), but another question arised.

    How can I add something like “o’clock” behind the time on the events detail page?

    My initial problem has been a misconfiguration in the theme, please ignore:

    <hr />

    I recently bought the developer-version of your plugin after testing it for a while.

    When I tried the event list widget, the time of the event always showed twice (like Event: Party from 20:00 20:00 to 23:00 23:00). I worked on the widget-event-list.php until I was satisfied.

    Now I have the same problem on the event details page (that shows when you click on the event’s name in the widget). It shows “Datum: 4. August, 11:30 11:30 – 7. August, 23:30 23:30”.

    <h2>Where and what do I have to change to prevent the plugin or the theme from doing this?</h2>

    Thank you in advance and with kind regards, Sebastian

    • This topic was modified 6 years, 8 months ago by  Sebastian Lammel.
    Sebastian Lammel
    #28065

    Hi Sebastian,

    The template defaults to the site’s date/time settings but to change it on that page only you need to copy the template/event-meta-event-single.php into your theme.

    In that function there are two calls to eo_format_event_occurrence() (see docs: http://codex.wp-event-organiser.com/function-eo_format_event_occurrence.html). The first three parameters you can set as the default (false).

    The fourth sets the time format, and you can use any of the ‘tokens’ listed here: http://php.net/manual/en/function.date.php

    To include literal text you need to escape each character with a backslash. So you could pass:

     "g \o\'\c\l\o\c\k"
    

    To the fourth argument and it would display something like 6 o’clock

    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 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.