Skip to content

Instantly share code, notes, and snippets.

@coreymcollins
Created February 7, 2014 13:43
Show Gist options
  • Save coreymcollins/8862825 to your computer and use it in GitHub Desktop.
Save coreymcollins/8862825 to your computer and use it in GitHub Desktop.
The Events Calendar Replaced Navigation
<?php
/**
* List View Nav Template
* This file loads the list view navigation.
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/nav.php
*
* @package TribeEventsCalendar
* @since 3.0
* @author Modern Tribe Inc.
*
*/
if ( !defined('ABSPATH') ) { die('-1'); } ?>
<h3 class="tribe-events-visuallyhidden"><?php _e( 'Events List Navigation', 'tribe-events-calendar' ) ?></h3>
<ul class="tribe-events-sub-nav">
<!-- Left Navigation -->
<?php if( tribe_is_past() ) : ?>
<li class="tribe-events-nav-next tribe-events-nav-left tribe-events-past">
<?php if( get_next_posts_link() ) : ?>
<a href="<?php tribe_get_past_link() ?>"><?php _e( '&laquo; Previous Events', 'tribe-events-calendar' ) ?></a>
<?php endif; ?>
</li><!-- .tribe-events-nav-previous -->
<?php elseif ( tribe_is_upcoming() ) : ?>
<?php if( get_previous_posts_link() ) : ?>
<li class="tribe-events-nav-left">
<?php echo get_previous_posts_link( __( '&laquo; Previous Events', 'tribe-events-calendar' ) ); ?>
<?php endif; ?>
</li><!-- .tribe-events-nav-previous -->
<?php endif; ?>
<!-- Right Navigation -->
<?php if( tribe_is_past() ) : ?>
<?php if( get_query_var( 'paged' ) > 1 ) : ?>
<li class="tribe-events-nav-previous tribe-events-nav-right tribe-events-past">
<a href="<?php echo tribe_get_past_link() ?>" rel="pref"><?php _e( 'Next Events &raquo;', 'tribe-events-calendar' ) ?></a>
<?php elseif( !get_previous_posts_link() ) : ?>
<li class="tribe-events-nav-right">
<?php echo get_next_posts_link( __( 'Next Events &raquo;', 'tribe-events-calendar' ) ); ?>
<?php endif; ?>
</li><!-- .tribe-events-nav-previous -->
<?php elseif ( tribe_is_upcoming() ) : ?>
<li class="tribe-events-nav-right">
<?php if( get_next_posts_link() ) : ?>
<?php echo get_next_posts_link( __( 'Next Events &raquo;', 'tribe-events-calendar' ) ); ?>
<?php endif; ?>
</li><!-- .tribe-events-nav-previous -->
<?php endif; ?>
</ul>
@mrwweb
Copy link

mrwweb commented Sep 25, 2014

An alternate take on generally the same thing: https://gist.github.com/mrwweb/db2f2808bfd751528df3

@davespice
Copy link

Hi guys do you know how to do this for photo view?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment