我已经创建了电影父主题的子主题。我想做的是重定向页面,如果它是移动的。
if ( wp_is_mobile() ) {
function mobile_home_redirect(){
include( get_stylesheet_directory() . '/abc.php' );
exit;
}
add_action( 'template_redirect', 'mobile_home_redirect' );
}
任何帮助都将非常感激!
您可以使用-header('Location: path here ');退出;