Going by the js you provided you can just do this
if ((screen.width <= 800) && (document.location="https://example.com/")) {
location.href = "https:example.com/m-home-page/";
}
You could also do this more dynamically using async request but if this solution is enough for you atm then go with it first.
Related Posts:
- Ajax template: how to handle head section
- How to allow download url redirection only if user logged in WordPress site?
- Ajax URLs without #!, how to prevent falling into single.php on load or reload?
- Exclude ipads and tablets form wp_is_mobile code
- Get permalink for a post from inside WordPress and route to a related site
- Combine CSS and JS files from plugins
- Display message once per session to users with a specific role
- How to preserve PHP modifications while upgrading WordPress?
- Nice scroll to wordpress
- How to use the php if statement [closed]
- lazy load comments wordpress on click
- How to turn off redirection from ‘domain.com/login’ to ‘domain.com/wp-login.php’
- How to block specific keywords from searching on WordPress?
- How to create filterable portfolio in WordPress?
- Using a javascript file to access a get posts array
- Minify HTML, CSS, JS with PHPWee?
- Run a Parallel PHP Application with WordPress
- Hiding a php element from mobile browsers
- Uncaught TypeError: Cannot read property ‘firstChild’ of null after upgrading to WordPress 5.5
- Access/update database with jQuery
- admin-ajax.php responding with 0
- Customizer Show/Hide
- Page Reloads Before AJAX Request Finishes
- How do I fetch all comments per post via WP REST API?
- Deregistering a script in WordPress seems impossible
- How to prevent those PHP variables from being cached on WordPress?
- Ajax return code 400
- Pass PHP variable to JavaScript without inline JS
- How do I display a user’s previous orders as a select box option on a product?
- How can I use a modal window to display the current post in loops featured image?
- Trigger popup in a php if/else statement
- How to select the contents in the text view textrea in wp_editor?
- 3 blogs same installation, without WP MU
- How to pass aa JS variable to PHP?
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- WordPress homepage infinite redirect
- Redirect undesirable domain
- Menu jumping when calling it via PHP
- Setting value of session with Ajax not working
- Accessing WPDB Multidimensional JSON Array w/ Javascript
- wordpress wp_enqueue_script() not working
- How to optimize the IF condition with many conditions and same output [closed]
- admin-ajax Firing Error 400 When Logged In
- Jquery window.send_to_editor function
- How to add drag and drop functionalities to a div inside option panel
- WordPress redirect redirecting too many times or not at all
- I am receiving a pluggable.php warning sign on my only http:// page
- Can’t add script immediately after the opening tag on login page?
- Override user-edit.php to design own profile page
- How to change logo by category
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- Run JS Code on userlog out
- Attaching images to posts manually (i.e. with custom code, without the use of an API)
- How to add 3 weeks to the_time() function
- Covert WordPress Blogname into JQuery
- Redirect to current user page upon link click
- PHP variables in a post?
- How to sort posts by active category in WordPress?
- Additional file upload in Gutenberg page options/featured image
- Display WordPress search results based on the selected Sub-Category
- Decode and Decrypt Azure B2C OpenID Authorization Token, Use Response in API Call (Example Token Within)
- Variation prices breakdown only for single product page
- Woocommerce disable order item link (backend) [closed]
- Post form – AJAX won’t upload featured image – Plugin development
- Integrate admin plugin into template. Very interesant (live search + autocomplete with wp rest api, in vanilla js)
- How to add JS script in specific pages in WordPress?
- Load more posts using AJAX based on posts inside WP_Query
- How can i find wrong word in search box and replace with correct word
- WordPress on Ubuntu – “File not Found” for home.php – Trying to Redirect to Root Folder
- How to use wp_ajax_set_post_thumbnail?
- Passing a value from an input field to a php function in WordPress?
- Display one random image from Media Library
- Google CSE Malfunctions via Chrome/Safari on Mobile When Clicking on Either Search Icon/Menu Icon. How to Make Google CSE Default Theme Search
- gettint error 400 with AJAX
- Using wp_editor() when not logged stopped working
- Modifying child theme’s header
- Show subcategory name selected in specific category woocoommerce
- Move Jquery.js to Footer
- Pass product object to javscript
- How to send Ajax Call from frontend without using wp_localize_script in Theme
- Complex PHP for json_encode > how to handle/output right?
- How can i iterate through this shortcode array?
- How to use Amazon Elastic Transcoder from WordPress using AWS SDK for PHP?
- Slider from different widgets
- add bootstrap modal after login in wordpress
- How to get values from wordpress listings and use them in javascript array?
- Help with my first Metabox helper class
- Trying to customize wordpress drop down categories
- Add multiple JavaScript files to template header [duplicate]
- What’s the best way to format ACF number fields for display on the front end?
- Redirect users not logged in to the standard login page (and back) from some posts and pages
- Add specific phrase after every product title including the discounted price? [closed]
- link to page_for_posts
- Trouble figuring out how to get my button to submit comment
- Load wp_editor on button click
- How to create a WordPress PAGE in another folder?
- Redirect loop upon installation of my plugin
- wp_login_url always redirects me to wp-admin
- Facing Problem While Running WordPress Hook For Archive, Categories, Author, Date Pages Only
- Weird Javascript:void(0) code in my website