yanknudtskov
9/22/2017 - 8:28 AM

Override The Events Calendar Plugin templates for events. Remember to copy the files /wp-content/themes/enfold/config-events-calendar/views

Override The Events Calendar Plugin templates for events.

Remember to copy the files /wp-content/themes/enfold/config-events-calendar/views/default-template.php /wp-content/themes/enfold/config-events-calendar/views/single-event.php

into

/wp-content/themes/enfold_child_theme_by_yanco/views/default-template.php /wp-content/themes/enfold_child_theme_by_yanco/views/single-event.php

<?php

	add_action( 'after_setup_theme', 'enfold_child_theme_code' );
	function enfold_child_theme_code() {
		if(is_child_theme()) remove_action('tribe_events_template', 'avia_events_tempalte_paths', 10, 2);
	}

	add_action('tribe_events_template', 'avia_events_template_paths_mod', 10, 2);
	function avia_events_template_paths_mod($file, $template)
	{
	    $redirect = array('default-template.php', 'single-event.php');
	    if(in_array($template, $redirect))
	    {
	        $file = get_stylesheet_directory() . "/tribe-events/views/".$template;
	    }

	    return $file;
	}