Tribe__Events__Pro__Main::select_page_template( string $template )

Get the path to the current events template.


Parameters

$template

(string) (Required) The current template path.


Top ↑

Return

(string) The modified template path.


Top ↑

Source

File: src/Tribe/Main.php

		public function select_page_template( $template ) {
			// venue view
			if ( is_singular( Tribe__Events__Main::VENUE_POST_TYPE ) ) {
				$template = Tribe__Events__Templates::getTemplateHierarchy( 'pro/single-venue' );
			}
			// organizer view
			if ( is_singular( Tribe__Events__Main::ORGANIZER_POST_TYPE ) ) {
				$template = Tribe__Events__Templates::getTemplateHierarchy( 'pro/single-organizer' );
			}
			// week view
			if ( tribe_is_week() ) {
				$template = Tribe__Events__Templates::getTemplateHierarchy( 'pro/week' );
			}

			// photo view
			if ( tribe_is_photo() ) {
				$template = Tribe__Events__Templates::getTemplateHierarchy( 'pro/photo' );
			}

			// map view
			if ( tribe_is_map() ) {
				if ( tribe_is_using_basic_gmaps_api() ) {
					$template = Tribe__Events__Templates::getTemplateHierarchy( 'pro/map-basic' );
				} else {
					$template = Tribe__Events__Templates::getTemplateHierarchy( 'pro/map' );
				}
			}

			// recurring "all" view
			if ( tribe_is_showing_all() ) {
				$template = Tribe__Events__Templates::getTemplateHierarchy( 'list' );
			}

			return $template;
		}