Last active
August 29, 2015 14:16
-
-
Save jamiebergen/03c0a22f32fecc66f13e to your computer and use it in GitHub Desktop.
The Events Calendar: To remove the All Events link from single-event.php and return to upcoming or archived events pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$start = tribe_get_start_date( null, false, 'Ymd' ); | |
$end = tribe_get_end_date( null, false, 'Ymd' ); | |
if ($end > $start) { | |
$event_date = $end; | |
} else { | |
$event_date = $start; | |
} | |
$now = date_i18n( 'Ymd' ); | |
echo '<p class="tribe-events-back">'; | |
// If its start or end date (whichever is later) is in the past, link to event archive | |
if ( $now > $event_date ) { | |
echo '<a href="'.get_page_link(1568).'">« Back to Archived Events</a>'; | |
} else { // otherwise, link to upcoming events | |
echo '<a href="'.get_page_link(2157).'">« Back to Upcoming Events</a>'; | |
} | |
echo '</p>'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment