Duration

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1004326
    Jane
    Participant

    I have two different event lists on my client’s site that use the [tribe_events-list] shortcode to get tribe-events/single-event.php list. One is customized w/ CSS to simulate my client’s print version of their calendar. Is there a way to list only the start & end times of the event in the duration field, i.e. not include the date in duration? Can it be done w/ CSS?

    Here are the two pages I am working on:
    http://www.theentertainernewspaper.com/wordpress/event-categories/

    And this page without the date in the duration:
    http://www.theentertainernewspaper.com/wordpress/event-list/

    #1004557
    George
    Participant

    Hey Jane,

    This is unfortunately not quite possible with CSS – but it should be possible with just a little bit of custom PHP instead. Try adding code like the following to your theme’s functions.php file, and let me know if it helps! 🙂


    add_filter( 'tribe_events_event_schedule_details_inner', 'tribe_support_1004326', 10, 2 );

    function tribe_support_1004326( $inner, $event_id ) {
    return tribe_get_start_time( $event_id );
    }

    Cheers,
    George

    #1006307
    Jane
    Participant

    That worked, I’m not sure what it’s doing in the background but it gave me the start time without the date. Thanks.

    #1006511
    George
    Participant

    Glad to hear it Jane! If you’re curious about what it is in fact doing in the background, then essentially all that’s happening is that where normally a date and time function are both used to generate the schedule details, this “hijacks” that process and only gives the code the time function – so no date is generated. 🙂

    Best of luck with your site!

    George

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Duration’ is closed to new replies.