Next Event Widget

Home Forums Calendar Products Events Calendar PRO Next Event Widget

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #19830
    Frank
    Participant

    I need to modify the next event widget to display the start and end time at the bottom.
    the website I am working on is http://zioncc.info
    here is the code I have now:
    * @return string
    */

    // Vars set:
    // ‘$event->AllDay’,
    // ‘$event->StartDate’,
    // ‘$event->EndDate’,
    // ‘$event->ShowMapLink’,
    // ‘$event->ShowMap’,
    // ‘$event->Cost’,
    // ‘$event->Phone’,

    // Don’t load directly
    if ( !defined(‘ABSPATH’) ) { die(‘-1’); }

    $event = array();
    $tribe_ecp = TribeEvents::instance();
    reset($tribe_ecp->metaTags); // Move pointer to beginning of array.
    foreach($tribe_ecp->metaTags as $tag){
    $var_name = str_replace(‘_Event’,”,$tag);
    $event[$var_name] = tribe_get_event_meta( $post->ID, $tag, true );
    }

    $event = (object) $event; //Easier to work with.

    ob_start();
    post_class($alt_text,$post->ID);
    $class = ob_get_contents();
    ob_end_clean();
    ?>

    <a href="ID) ?>”>post_title ?>

    ID, isset($start) ? $start : null );

    if($event->AllDay && $start)
    echo ‘ (‘.__(‘All Day’,’tribe-events-calendar-pro’).’)’;
    ?>

    #19837
    Rob
    Member

    Hey Frank. Thanks for the note here. Not sure about this myself, but let me see whether Jonah from our dev team can point you in the right direction here. He’s hitting the forums this afternoon. Stay tuned and thanks for your support.

    #19865
    Frank
    Participant

    I found my answer already.
    use:
    echo tribe_get_start_date( $post->ID, false, “F j, g:i a” );

    instead of:

    echo tribe_get_start_date( $post->ID, isset($start) ? $start : null );

    #19870
    Frank
    Participant

    now, how can I get the next event to show as soon as the current event ends.
    Say, if the event ends at 5:30 PM, then show whatever event is next in the calendar without having to wait until the next day.

    #19880
    Jonah
    Participant

    Hi Frank,

    Unfortunately this is not currently available in the plugin and I’m not sure how to hack it to make it work. I’ve filed a ticked to have this fixed in an upcoming version but for now you’ll need to figure this out on your own.

    Sorry I can’t offer up more here.

    – Jonah

    #19884
    Frank
    Participant

    Hi Jonah,
    Since it can’t do that. Then, how about showing two events. Then, it will show today’s event through midnight and the next event in the calendar. Is there a way to do that?

    Thanks.

    #19896
    Jonah
    Participant

    Hi Frank,

    Yes, you can make it so it shows two events. To do this it’s somewhat complicated but I’ve written a tutorial on it that can guide you through: https://theeventscalendar.com/how-to-completely-customize-widgets/

    The tutorial deals with the same widget and all you’ll need to change is the query parameter here from:

    $posts = tribe_get_events( 'eventDisplay=upcoming&numResults=1&eventCat=' . $category );

    …to:

    $posts = tribe_get_events( 'eventDisplay=upcoming&numResults=2&eventCat=' . $category );

    I hope that helps!

    – Jonah

    #19910
    Frank
    Participant

    Thanks Jonah! I am going to try this and let you know how it goes. Thank you for the awesome tech support.

    I hope the widget gets this capability on the next update. From what I have found in the forum I am not the only one who has made this observation. If the event ends at 5:30 PM on Tuesday and it’s 5:31 PM on Tuesday that event is no longer the next event. But the way things stand now, you have to wait until 12:01 AM on Wednesday to see the next event.

    #19921
    Rob
    Member

    Hey Frank. Glad to hear Jonah’s help above can be of some value; let us know if you encounter any issues when attempting it.

    As for the widget capabilities: while it probably won’t make the next release (since we entered code freeze today), it should be something we can include in one our next builds. We do these releases monthly and this is currently in the pile for next month.

    #976969
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Next Event Widget’ is closed to new replies.