Home › Forums › Calendar Products › Events Calendar PRO › Next Event Widget
- This topic has 9 replies, 4 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
May 29, 2012 at 11:34 am #19830
Frank
ParticipantI 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’).’)’;
?>May 29, 2012 at 1:02 pm #19837Rob
MemberHey 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.
May 29, 2012 at 6:50 pm #19865Frank
ParticipantI 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 );
May 29, 2012 at 7:20 pm #19870Frank
Participantnow, 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.May 29, 2012 at 7:55 pm #19880Jonah
ParticipantHi 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
May 29, 2012 at 8:58 pm #19884Frank
ParticipantHi 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.
May 29, 2012 at 10:57 pm #19896Jonah
ParticipantHi 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
May 30, 2012 at 7:16 am #19910Frank
ParticipantThanks 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.
May 30, 2012 at 7:45 am #19921Rob
MemberHey 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.
July 7, 2015 at 6:20 am #976969Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘Next Event Widget’ is closed to new replies.
