💡 Note: The Events Calendar is not fully compatible yet with Full Site Editing, which is a part of the Twenty TwentyTwo theme. Thus, we recommend running the conflict test with Twenty Twenty.

Once in a while, people ask us if there’s a way to have the calendar show a specific month or date range, instead of defaulting to the current view. This can be useful for calendars that showcase a yearly festival or otherwise want to highlight a specific time.

Adding the snippet below to your functions.php file will change the default date for the calendar to January 1, 2015. You can change the date in the snippet to make it the date you want. Keep in mind that this will impact all views.

<?php

/**
 * Sets the default date for event queries.
 *
 * Expects to be called during tribe_events_pre_get_posts. Note that this
 * function modifies $_REQUEST - this is needed for consistency because
 * various parts of TEC inspect that array directly to determine the current
 * date.
 * 
 * @param WP_Query $query
 */
function tribe_force_event_date( WP_Query $query ) {
    // Don't touch single posts or queries other than the main query
    if ( ! $query->is_main_query() || is_single() ) {
        return;
    }

    // If a date has already been set by some other means, bail out
    if ( strlen( $query->get( 'eventDate' ) ) || ! empty( $_REQUEST['tribe-bar-date'] ) ) {
        return;
    }

    // Change this to whatever date you prefer
    $default_date = '2015-10-01';

    // Use the preferred default date
    $query->set( 'eventDate', $default_date );
    $query->set( 'start_date', $default_date );
    $_REQUEST['tribe-bar-date'] = $default_date;
}

add_action( 'pre_get_posts', 'tribe_force_event_date' );