-
-
Save paulgeisler/7572855 to your computer and use it in GitHub Desktop.
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
<div class="tribe-events-nav-previous"> | |
<?php // Display Previous Page Navigation | |
if( tribe_is_upcoming() && get_previous_posts_link() ) : ?> | |
<?php previous_posts_link( '<span>'.__('« Previous Events', 'tribe-events-calendar').'</span>' ); ?> | |
<?php elseif( tribe_is_upcoming() && !get_previous_posts_link( ) ) : ?> | |
<a href='<?php echo tribe_get_past_link(); ?>'><span><?php _e('« Previous Events', 'tribe-events-calendar' ); ?></span></a> | |
<?php elseif( tribe_is_past() && get_next_posts_link( ) ) : ?> | |
<?php next_posts_link( '<span>'.__('« Previous Events', 'tribe-events-calendar').'</span>' ); ?> | |
<?php else : ?> | |
<span class="inactive"><?php _e('« Previous Events', 'tribe-events-calendar'); ?></span> | |
<?php endif; ?> | |
</div> | |
<div class="tribe-events-nav-next"> | |
<?php // Display Next Page Navigation | |
if( tribe_is_upcoming() && get_next_posts_link( ) ) : ?> | |
<?php next_posts_link( '<span>'.__('Next Events »', 'tribe-events-calendar').'</span>' ); ?> | |
<?php elseif( tribe_is_past() && get_previous_posts_link( ) ) : ?> | |
<?php previous_posts_link( '<span>'.__('Next Events »', 'tribe-events-calendar').'</span>' ); // a little confusing but in 'past view' to see newer events you want the previous page ?> | |
<?php elseif( tribe_is_past() && !get_previous_posts_link( ) ) : ?> | |
<a href='<?php echo tribe_get_upcoming_link(); ?>'><span><?php _e('Next Events »', 'tribe-events-calendar'); ?></span></a> | |
<?php else : ?> | |
<span class="inactive"><?php _e('Next Events »', 'tribe-events-calendar'); ?></span> | |
<?php endif; ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment