• Hi

    We have put together several calendars and many of them have multiple events on a single day, at different times. When hovering over these in the calendar view, a popup says for example “3 events” and then clicking the date takes you through to a listing of this events.

    However, in that page listing the events, they are not ordered by time and only show the title of the event and not the time. For example see:

    https://www.harboroughlcjuniors.org.uk/2016/09/14/?post_type=sp_event

    Ideally, I would like to order these by time, so the first event in the day is shown first and also display the time somewhere, along with the title.

    Is there a way to do this via settings? Or do I need to start looking at the code? If so, which code?

    Thanks in advance.

    John

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jafannonwp

    (@jafannonwp)

    I’ve spent some time looking at this today and had to make the following changes to fix this:

    1) Change the rookie theme content-page.php to include the following above the title, to show the time of the post, where there are multiple:

    		
    <!-- Post time -->
    <?php if ( ! is_single() && ! is_page()) { ?><div class="entry-time"><?php the_time(); ?></div><?php } ?>
    
    <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    

    2) Change the event-calendar.php to add two additional query parameters to the calendar links to control the ordering of results:

    
    	if ( array_key_exists($day, $daywithpost) ) // any posts today?
    		$calendar_output .= '<a data-tooltip data-options="disable_for_touch:true" class="has-tip" href="' . ( sizeof( $daywithpost[ $day ] ) > 1 ? add_query_arg( array( 'post_type' => 'sp_event', 'orderby' => 'date','order' => 'asc'), get_day_link( $thisyear, $thismonth, $day ) ) . '" title="' . sprintf( '%s events', ( sizeof( $daywithpost[ $day ] ) ) ) : get_post_permalink( $daywithpost[ $day ][0], false, true ) . '" title="' . esc_attr( $ak_titles_for_day[ $day ] ) ) . "\">$day</a>";
    	else
    		$calendar_output .= $day;
    

    If there is a better way, please let me know. It would be great if these changes can be included in a future release.

    John

    Roch

    (@rochesterj)

    Hi!

    Thanks a lot for sharing how you’ve fixed it!

    It seems to be fine for me!

    PS: I could swear I replied to this one, but my reply isn’t here anymore.. weird!

    Kind Regards,
    -Roch

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ordering and times where there are multiple events on one day’ is closed to new replies.