Title: wp_is_mobile() Problem
Last modified: July 24, 2024

---

# wp_is_mobile() Problem

 *  Resolved [youssef2016](https://wordpress.org/support/users/youssef2016/)
 * (@youssef2016)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/wp_is_mobile-problem/)
 * Hello,
 * Since the last update (6.3), wp_is_mobile() is ignored by LiteSpeed ​​Cache and
   does wrong behavior (displaying desktop js, css, etc in mobile), I went back 
   to version (6.2.0.1) and the problem went away so I checked That’s the problem
   with the new update.
 * I hope the problem is resolved as soon as possible.
 * Thanks.

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/wp_is_mobile-problem/#post-17909651)
 * please provide the report number
 * you can get it in toolbox -> report -> click “send to LiteSpeed”
 *  Thread Starter [youssef2016](https://wordpress.org/support/users/youssef2016/)
 * (@youssef2016)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/wp_is_mobile-problem/#post-17909697)
 * Report number: **IVVFEGKK**
 * Report date: **07/24/2024 11:22:27**
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/wp_is_mobile-problem/#post-17913241)
 * when you say ignored , could you please be more specific what is the full context
   here ?
 * like you have some custom code that uses this function ? I mean , what’s the 
   full story about your usage with it ?
 *  Thread Starter [youssef2016](https://wordpress.org/support/users/youssef2016/)
 * (@youssef2016)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/wp_is_mobile-problem/#post-17914617)
 *     ```wp-block-code
       <? if( wp_is_mobile() ) { ?><script src="/Assets/js/mobile.js?v=1.0"></script><? } else { ?><script src="/Assets/js/desktop.js?v=1.0"></script><? } ?>
       ```
   
 * I use it like this example, and plugin give me desktop.js on mobile.
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/wp_is_mobile-problem/#post-17914622)
 * now that is weird if you open the same URL with query string like `?test` attach
   to it , does it give correct response ?
 *  Thread Starter [youssef2016](https://wordpress.org/support/users/youssef2016/)
 * (@youssef2016)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/wp_is_mobile-problem/#post-17914630)
 * Yes, it gives the correct js file
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/wp_is_mobile-problem/#post-17914650)
 * if you do a purge all , then first access on mobile , does it give correct file?
 *  Thread Starter [youssef2016](https://wordpress.org/support/users/youssef2016/)
 * (@youssef2016)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/wp_is_mobile-problem/#post-17914702)
 * No, but if I changed the version ?v=1.0 then purge all, first access on mobile
   gives the correct file
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/wp_is_mobile-problem/#post-17914713)
 * okay , please try , change that ?v=1.0 to something , like v=1.1 or v=2.0
 * purge all
 * first access on mobile , check the file , refresh page and make sure cache hit
 * then open it again in desktop , see what it shows
 * then test it reverse , purge all , access on desktop , refresh page and make 
   sure cache hit , then check on mobile again.
 *  Thread Starter [youssef2016](https://wordpress.org/support/users/youssef2016/)
 * (@youssef2016)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/wp_is_mobile-problem/#post-17914832)
 *     ```wp-block-code
       <? if( wp_is_mobile() ) { ?><script src="/Assets/js/mobile.js?v=1.0"></script><? } else { ?><script src="/Assets/js/desktop.js?v=1.0"></script><? } ?>
       ```
   
 * This code is in header.php file, and it used to display separate js file for 
   mobile & desktop, when I change ?v=1.0 to any version like 1.1 or 1.5, the first
   access on mobile gives mobile.js and cache hit then on refresh page multiple 
   times it gives desktop.js on mobile, The problem occurs on version (6.3) but 
   if I go back to (6.2.0.1) the problem went away.
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/wp_is_mobile-problem/#post-17917885)
 * that is weird, I am not aware of changes on mobile detection between these 2 
   version
 * please create a ticket by mail to `support at litespeedtech.com` with reference
   link to this topic , we will investigate further.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘wp_is_mobile() Problem’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/wp_is_mobile-problem/#post-17917885)
 * Status: resolved