Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Redirect homepage on mobile
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Redirect homepage on mobile
add_action( 'wp_head', 'wps_params', 10 );
function wps_params() {
if (window.location.pathname == '/' && jQuery(window).width() <= 480) {
window.location = "/webshop/";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment