Support » Plugin: Event Organiser » Single event calendar import search result dates

  • Two minor functionality things which I’m just curious about here:

    1) Is there a simple enough way to have a link on each event page to add that particular event to your calendar software of choice (or at least just Google Calendar?). I’ve got the full calendar subscription links up on the homepage but a link per-event for someone to add just the events they’re going to would be cool. It would be especially handy if you could select a single occurrence of a reoccurring event.

    2) When typing in the usual search field for blog posts and events listings, how would I go about showing the date and venue below the titles in the Search Results? I’m not sure how to do this without breaking things for regular blog posts which obviously don’t have a date or venue.

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Well would you look at that – I’ve found the documentation for adding a single event to Google Calendar. I should have looked harder before posting!

    Though so long as I’m posting, I’ve noticed a few issues with adding the following code into an event page:

       //Inside the loop
       $url = eo_get_the_GoogleLink();
       echo '<a href="'.esc_url($url).'" title="Click to add this event to a Google calendar"> Add to Google </a>';

    If an event name contained an apostrophe (‘) then the name will cut off in Google Calendar at that point. Also, the times seem to be off – I don’t know if this is a time zone thing. Recurring events will also only add the date for the first occurrence of it.

    Hi vyabsley,

    That function isn’t well documented (and is poorly implemented – and the name doesn’t follow WP convention :/ ). It is actually only intended to register a particular occurrence ( and can only be used inside the loop ). So depending on the query, it may appear that only the first occurrence of a recurring event is added. But you can use it to add any occurrence to a Google calendar.

    For (2), you can (inside your search results template) check:

    if( ‘event’ == get_post_type( $post ) ){
    //Stuff for events here

    But a joint event & post search will treat events as ‘posts’ in the sense that it will only appear once (not once for each occurrence). Once you’ve checked the post type (as above) you can then use functions like eo_get_the_occurrences_of() or eo_get_next_occurrence_of().

    (On a related not, Event Organiser Pro will come with an ‘event search shortcode’)

    Sorry to bump such an old thread, but I can’t seem to get this working any more!

    It would be very useful to be able to add a single event to a Google (or iCal) calendar.

    Ideally what I’m trying to do is make it so that in the event-meta, the date is clickable to add the single event to the calendar. This way, for single events, just clicking the date is fine – and for reoccuring events, since you have a list of dates to pick from you can click on the one that you want to add to your calendar.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Single event calendar import search result dates’ is closed to new replies.