Skip to content

Instantly share code, notes, and snippets.

@brianjking
Forked from jesseeproductions/tec-mon-redirect
Created December 1, 2015 16:45
Show Gist options
  • Save brianjking/503cd352f856f47e0ddc to your computer and use it in GitHub Desktop.
Save brianjking/503cd352f856f47e0ddc to your computer and use it in GitHub Desktop.
The Events Calendar - Redirect Mobile Users to List View
/*
* The Events Calendar - Redirect Mobile Users to List View
* @version 3.9
*
* @link http://theeventscalendar.com/support/forums/topic/forcing-list-view-on-mobile-only/
*/
add_action( 'template_redirect', 'tec_mobile_template_redirect' );
function tec_mobile_template_redirect() {
if( tribe_is_month() && wp_is_mobile() ) {
wp_redirect( tribe_get_listview_link() );
exit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment