v2 views
-
i have used the plugin for many years and love it , i had some template overides set up and have been putting off going to the v2 views. now i feel its time to get it done.
i have always used a full width template for the /events month view and a single.php for all other pages with sidebar.i used for many years
function tribe_theme_template_chooser ( $template ) { * Example for changing the template for the single-event page to custom-page-template.php * Template is usually set to /plugins/the-events-calendar/src/views/default-template.php * You might wish to include some things from that template in your custom one, such as * the function tribe_get_view() which helps format the content within your template. * You can modify this example to set the template for any tribe page. Month view could be * modified by instead using the tribe_is_month() condition. // Single event page if ( is_single() ) { $template = locate_template( 'single_event2.php' ); } if ( tribe_is_month() ) { $template = locate_template( 'tpl-full-width.php' ); } return $template; } add_filter( 'template_include', 'tribe_theme_template_chooser', 52 );
with great success . this how ever does no longer work with the v2 views ,
i have installed the tweaks extensions to try to resolve this.
i have the display setting as full-width.php and the tweak setting as calendar only ,in my functions i haveadd_filter( 'tribe_events_views_v2_use_wp_template_hierarchy', function($template) { if ( ! is_month() ) { $template = locate_template( 'single.php' ); } return $template; }, 10, 4 );
this leads to undesirable outcomes . what is the best function to use to simpley use the default events calendar view for all views that are not month? thanks in advance
- The topic ‘v2 views’ is closed to new replies.