Forum Replies Created
-
AuthorPosts
-
SethParticipant
Sure, I created a shortcode so I could display upcoming events on any page/post.
/* Upcoming events shortcode ****************************************************************/
function events_shortcode($atts) {
extract(shortcode_atts(array(
'category' => '',
'limit' => 4,
'display_city' => false
), $atts));$events = ''; // Will contain all of the events to display
global $wp_query;
$tribe_ecp = TribeEvents::instance();$old_display = $wp_query->get('eventDisplay');
$event_options = array(
'numResults' => $limit,
'tribe_events_cat' => $category,
'eventDisplay' => 'upcoming'
);$event = tribe_get_events( $event_options );
if(!$event[0]) {
$events .= 'There are no upcoming events at this time.';
} else {$counter = 1;
foreach($event as $e) :
if($counter % 2) { $events .= ''; }
$event_categories = get_the_terms( $e->ID, $tribe_ecp->get_event_taxonomy());$events .= '';
$events .= '';
$events .= tribe_get_start_date($e->ID, false, 'M').''.tribe_get_start_date($e->ID, false, "j");
$events .= '';
$events .= 'ID).'">'.get_the_title($e->ID).'';
$events .= '';
if(tribe_get_start_date($e->ID, false, 'g:i a') !== '12:00 am') {
$searchArray = array(":00", "am", "pm");
$replaceArray = array("", "a.m.", "p.m.");
$events .= str_replace($searchArray, $replaceArray,tribe_get_start_date($e->ID, false,'g:i a')) .' - ';
}
if(tribe_has_venue($e->ID)) {
$events .= tribe_get_venue($e->ID);
}
$events .= '';
if(tribe_get_city($e->ID) && $display_city) {
$events .= ''.tribe_get_city($e->ID).', '. tribe_get_state($e->ID).'';
}
$events .= '';
$counter++;
if($counter > $limit) { break; }
endforeach;
}
wp_reset_query();
$events .= '';
return $events;
}
add_shortcode('events', 'events_shortcode');January 19, 2012 at 6:15 am in reply to: Removing one category of events from main event list and calendar. #13611SethParticipantYep that’s right.
SethParticipantYou guys are great, thanks!
SethParticipant@Rob, yep just like you said. I was thinking of an “Add another” type of feature for dates.
SethParticipantCurrently there is no great way to link to a recurring event. You can link to a specific occurrence, to the series list, or to the base URL which by default goes to the first event of the series.
Maybe there could be an option in the settings:
Base URL for recurring events links to:
[ ] First event in series
[x] Next upcoming event in series
[ ] Series listThat way I could link or tell someone go to http://www.website.com/event/event-name/ and know that it will always take them to the next upcoming event of that series.
SethParticipantMany of my events*
SethParticipantI would like a way to add random dates to an event. Many of my dates don’t have any rhyme or reason to how they repeat.
SethParticipantYep similar, with the addition of linking to the next upcoming event.
SethParticipantA way to link to the next upcoming event in a series would be nice. That way if someone ends up viewing an event that has passed you could link them to the next one.
“This event has passed. The next upcoming date for this event is March 1, 2012.”
SethParticipantThanks, keep up the good work!
SethParticipantis_reoccuring() *
SethParticipantHoping to get this bumped up in the list. I’m in need of using the function tribe_get_start_date() for reoccurring events using a post ID. I see in the comments above the function that it is already known and planned.
Also a reoccurring() function might be nice too.
December 15, 2011 at 12:54 pm in reply to: After upgraded to 2.02. Start date & end date disappeared #12354SethParticipantIt didn’t work in 2.0 either.
The documentation right before the function tribe_get_start_date() mentions that the function does not work with a post ID for reoccurring events.
December 15, 2011 at 12:24 pm in reply to: After upgraded to 2.02. Start date & end date disappeared #12351SethParticipantWell that solved one issue, the dates show up now which is good. However it is showing the date the reoccurring series originally started rather than this specific event’s start time.
December 15, 2011 at 12:12 pm in reply to: After upgraded to 2.02. Start date & end date disappeared #12349SethParticipantI’m also in need of a (hopefully quick) fix to tribe_get_start_date() for reoccurring events. I see in the comments that it’s a known issue already.
-
AuthorPosts