Question about Custom code for mobile
-
Hello,
In a web project I use code to insert data-no-lazy=”1″ to the images that I want to exclude. Everything works fine, it’s just that on mobile the images to be excluded are much fewer.
The solution I did was to use the native wordpress function wp_is_mobile(), so that if the condition is met the number of exclusions is inserted and if negative the desktop exclusions are inserted
It works fine, but I would like to have maximum consistency with the LiteSpeed Cache logic, so that the number of images is the same throughout the “mobile cache” (I have it enabled)
Is there a function or filter that can be used to insert code into the mobile version? or wp_is_mobile() is already enough and okay?
Thanks greetings !
- The topic ‘Question about Custom code for mobile’ is closed to new replies.