Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
Created May 21, 2015 17:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jesseeproductions/fc21ce52314f31dc230b to your computer and use it in GitHub Desktop.
Save jesseeproductions/fc21ce52314f31dc230b 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