Meta Box
Support Forum
Support › MB Views › Show Views template on mobile or desktop conditionally
Hi, do you know if there is a way to show or hide content based on device or screensize using the if/else function?
I dont wish to use CSS ‘display: none’ as it would still load the hidden images I believe.
Hope you have an idea/example
Regards, Rod
Hi Rod,
If you are familiar with coding and using Twig, you can follow this topic to use a Twig bundle to check the screen size https://stackoverflow.com/questions/39095492/twig-how-to-modify-template-based-on-screen-size https://docs.metabox.io/extensions/mb-views/#external-template-files
But I recommend using JavaScript (jQuery) instead of using the server-side language to check the browser (screen) size. It is more flexible and easy to use.