Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This is an example of a customized month navigation with a Return to Current Month link added.
<?php
/**
* Month View Nav Template
* This file loads the month view navigation.
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/month/nav.php
*
* @package TribeEventsCalendar
*
*/
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
} ?>
<?php do_action( 'tribe_events_before_nav' ) ?>
<h3 class="tribe-events-visuallyhidden"><?php _e( 'Calendar Month Navigation', 'tribe-events-calendar' ) ?></h3>
<ul class="tribe-events-sub-nav">
<li class="tribe-events-nav-previous">
<?php tribe_events_the_previous_month_link(); ?>
</li>
<?php if ( date_i18n( 'Y-m-01' ) !== tribe_get_month_view_date() ): ?>
<li class="tribe-events-nav-current">
<a href="<?php echo TribeEvents::instance()->getLink( 'month' ) ?>">Back to Current Month</a>
</li>
<?php endif ?>
<!-- .tribe-events-nav-previous -->
<li class="tribe-events-nav-next">
<?php tribe_events_the_next_month_link(); ?>
</li>
<!-- .tribe-events-nav-next -->
</ul><!-- .tribe-events-sub-nav -->
<?php do_action( 'tribe_events_after_nav' ) ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.