Archived topic
Display rules for elements based on screen size
1 reply · Started by Steven on September 24, 2019
Is there a way to exclude an element based on mobile/tablet/desktop? If not, that'd be a great option on the display rules screen.
Hi there,
Server side detection of the device size can be rather hit and miss due to continuous changes in mobile tech. So we're not confident it would be a stable solution.
You could use an element display filter to remove the element using the wp_is_mobile() function as a condition and see how it goes:
https://developer.wordpress.org/reference/functions/wp_is_mobile/