Recurring events exact date/time

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

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

    Hello,

    In a single event I would like to have the exact date/time of a recurring event instead of “This event is running from xxx until xxx. It is next occurring on xxx.”
    This is happening when I click on an event to see the detail from the calendar general view.

    Karen Acklin
    #20280

    Hi Karen,

    That text can be found in templates/event-meta-event-single.php and displays for recurring events. You can copy that template into your theme and edit it there.

    However, please note that each occurrence points to the same page, so by default it’s not possible to detect which occurrence the user clicked.

    This is technically possible, but requires some set up, including:

    1. Changing the event URL in the calendar to something like .../events/event/my-event/123 (for occurrence with ID 123).
    2. Registering a rewrite rule to understand that URL to mean event ‘my-event’ and occurrence ID 123.
    3. Editing the templates to take account of the occurrence ID being passed through, and using that information as required.

    For (1) and if you only care about the calendar you can use this filter: http://codex.wp-event-organiser.com/hook-eventorganiser_calendar_event_link.html

    For (2) you may want to read the WordPress codex on adding rewrite rules: https://codex.wordpress.org/Rewrite_API/add_rewrite_rule

    For (3) if you can retrieve a value parsed from the URL via get_query_var('...') (codex: https://codex.wordpress.org/Function_Reference/get_query_var)- the argument will depend on what you set for (2). You should handle situations where no ID is given.

    I hope that gets you started in the right direction.

    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.