Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Let's use the template_include filter, but run our code later than
- * Tribe's own template chooser code (priority 20).
- */
- add_filter('template_include', 'override_tribe_tpl_choice', 20);
- /**
- * We'll leave any template choices not relating to event queries
- * alone - and use the theme's single.php template for single
- * events/venues etc and page.php for everything else.
- *
- * This could of course be easily changed to use whichever particular
- * template you prefer.
- *
- * @param $tpl
- * @return string
- */
- function override_tribe_tpl_choice($tpl) {
- if (!tribe_is_event_query()) return $tpl;
- if (is_singular()) return locate_template('single.php');
- return locate_template('page.php');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement