Skip to content

Instantly share code, notes, and snippets.

@ckpicker
ckpicker / gist:3277768
Created August 6, 2012 19:23
Button Code
<input type="button" value="Click here to go somewhere" onclick="window.open('<?php echo tribe_get_custom_field('YourCustomFieldLabelGoesHere'); ?>');" />
@ckpicker
ckpicker / gist:3278002
Created August 6, 2012 20:02
EC Pro Redirect
<?php
//Query Events and get next upcoming
$postslist = query_posts('order=DESC&orderby=modified&posts_per_page=1&post_type=tribe_events&eventDisplay=upcoming');
if(!empty($postslist)) {
//Grab Start date from next upcoming event and use /YYYY-MM/ in events URL
$eventStartDate = strtotime($postslist[0]->EventStartDate)
$nextUpcomingLink = tribe_get_events_link() . date('Y-m', $eventStartDate) . '/';
} else {
$nextUpcomingLink = tribe_get_events_link();
@ckpicker
ckpicker / gist:3291286
Created August 8, 2012 01:39
Old List.php code
<?php if ( tribe_is_new_event_day() && !tribe_is_day() ) : ?>
<h4 class="event-day"><?php echo tribe_get_start_date( null, false ); ?></h4>
<?php endif; ?>
@ckpicker
ckpicker / gist:3291292
Created August 8, 2012 01:41
New List.php Code
<?php if ( tribe_is_new_event_day() && !tribe_is_day() ) : ?>
<?php if(tribe_is_multiday()) { ?>
<h4 class="event-day"><?php echo tribe_get_start_date( null, false ); ?> - <?php echo tribe_get_end_date( null, false ); ?></h4>
<?php } else { ?>
<h4 class="event-day"><?php echo tribe_get_start_date( null, false ); ?></h4>
<?php } ?>
<?php endif; ?>
@ckpicker
ckpicker / gist:3291389
Created August 8, 2012 02:00
Old Widget Code
echo tribe_get_start_date( $post->ID );
if( tribe_is_multiday( $post->ID ) || !$event->AllDay ) {
echo ' - ' . tribe_get_end_date($post->ID);
}
@ckpicker
ckpicker / gist:3291479
Created August 8, 2012 02:20
New EC Widget Code
if( tribe_is_multiday( $post->ID ) {
//Don't include the time
echo tribe_get_start_date($post->ID, false, 'F j, Y');
} else {
echo tribe_get_start_date( $post->ID );
}
if( tribe_is_multiday( $post->ID ) || !$event->AllDay ) {
//Don't include the time
echo ' - ' . tribe_get_end_date($post->ID, false, 'F j, Y');
<?php
if(tribe_get_custom_field('eventtype') == 'Webinar') {
?>
<input type="button" value="Click here to go somewhere" onclick="window.open('<?php echo tribe_get_custom_field('WebinarURLField'); ?>');" />
<?php
} elseif(tribe_get_custom_field('eventtype') == 'Lunch') {
?>
<?php
/**
* A single event. This displays the event title, description, meta, and
* optionally, the Google map for the event.
*
* You can customize this view by putting a replacement file of the same name (single.php) in the events/ directory of your theme.
*/
// Don't load directly
if ( !defined('ABSPATH') ) { die('-1'); }
<dt class="event-label event-label-updated"><?php _e('Updated:', 'tribe-events-calendar') ?></dt>
<dd class="event-meta event-meta-updated"><span class="date updated"><?php the_date(); ?></span></dd>
<!--<dt class="event-label event-label-updated"><?php _e('Updated:', 'tribe-events-calendar') ?></dt>
<dd class="event-meta event-meta-updated"><span class="date updated"><?php the_date(); ?></span></dd>-->