WordPress has a function called wp_is_mobile. It does very simple User Agent checking, which isn’t very reliable. There are a lot of user agents out there and they can easily be falsified. There is no guarantee that a browser representing itself as some user agent actually is that user agent. You can do more complicated user agent checking but it is still user agent checking.
But you also don’t have a lot of choice with a server side script. I would use wp_is_mobile, or some more complicated version, to hedge my bets. It may save some load time in some, maybe many, cases. But make sure that media queries deal with the important stuff.
Related Posts:
- make WordPress image captions responsive
- Responsive Theme Design: how have slideshow on desktops/tablets and static photo on mobile using same template?
- How to get attachment id of background image?
- Pb with responsive image sizes in WP 4.4
- $content_width for responsive UI
- How do I make featured images retreived by the_post_thumbnail() responsive?
- GIF featured image is resized on server but not used in frontend. Why?
- Responsive 2 column staggered layout client expectations vs reality problem
- Responsive Video Max-width
- How to force the twentyfourteen narrow screen layout to apply to wide screens?
- twentythirteen h1 and h2 not resizing responsively
- YouTube video goes over sidebar [closed]
- Wp_List_Table not responsive
- mobile vs responsive sites [closed]
- Responsive Theme Design: how have slideshow on desktops/tablets and static photo on mobile using same template?
- responsive not working
- I want to add “View Desktop Version” for mobile visitors for my wordpress site
- Navigation Menu Rendering Issue on Windows 10
- Header Logo Scaling
- nextgen pro horizontal filmstrip moves up as browser narrows
- The hyperlink not responsive with post? [closed]
- Create various image sizes ad hoc
- Trouble with responsivitizing my twentythirteen header
- site is loading fully zoomed in on mobile devices
- Show content based on width?
- making images scalable for responsive designs [closed]
- Is Twenty Eleven Theme Responsive ? any update? [closed]
- How I can add responsive font size in theme.json file
- Create image formats with different qualities when uploading
- How can I set image sizes and still have responsive images using the srcset attribute?
- Responsive Images
- Excess White Space Above Admin Bar on Frontend Using Twitter Bootstrap
- Generating Responsive Background Image Sizes in PHP
- How to Make WordPress Default gallery responsive on mobile?
- How can I make wp default gallery responsive?
- Get specific image size for small viewport width
- Video to stretch across the entire homepage [closed]
- Meta tag viewport
- How to display a different image size for mobile
- How to make wordpress theme iframe responsive
- Mobile issue – website isn’t properly detecting screen size [closed]
- adaptive featured images wordpress 4.4 grid
- Modify ‘Sizes’ Attribute for Images with Specific Class
- How to Implement Responsive YouTube Video Framing? [closed]
- wp_editor responsive?
- My website is not responsive on mobile devices
- Move Sidebar from Above Content To Below When Responsive [closed]
- Change Responsive Images Maximum Width of 1600px
- Custom responsive ‘featured image’ sizes
- One of my image sizes isn’t showing up in srcset
- srcset and custom field get_post_meta and wp_get_attachment_url
- How to load different homepage on Mobile.?
- Serve a different theme based on window size
- Change Header Image on Blog Post for Mobile View
- How to stop WordPress from completely overriding my tags in my templates?
- Change Menu Button Text [closed]
- the_content not showing responsive image attributes srcset or sizes
- Different column width in 2 rows with bootstrap and custom post types-different classes needed
- How to create a non-responsive WordPress Theme Using Genesis Framework?
- Define width of featured image thumbnails, but also make responsive?
- Change Image Sizes for Mobile Theme
- Change twentytwelve sidebar responsive relocation?
- Twenty Eleven Theme Adjusts for iPhones. How to stop this feature?
- Efficient wp mobile menu
- About Custom Email Template Design Responsive
- My theme header is stuck on a low resolution image?
- is there a way to preload specific images for desktop users only? (excluding mobile users)
- Responsive header image
- Cannot collapse a responsive menu in WordPress
- tinymce and responsive line-breaks (short words after a period)
- Disable Responsive Image Sizes crop
- Shortcode function not showing up on mobile browser
- How to make in wordpress a gallery with 3 colums to 1 on mobile devices responsive?
- WordPress 5: including larger thumbnail image sizes in srcset than I have set
- Disable rendering of objects on mobile/above certain screen resolution
- New Styles Not Rendering On Mobile Phone and Tablet
- Menu is in Reversed order
- Decide how Hero image appears on mobile
- Responsive images with srcset
- Getting extra image links in code with wp_get_attachment_image
- built-in responsive images in content – do I need to add anything to functions.php?
- Sidebar widgets are over the content in mobile mode, how can I fix it? [closed]
- responsive website
- Should I detect the device or the page first?
- Responsive Wordress Site – Serve different post types to each device
- Ads below footer
- Serving resized images on a responsive site without making 2x copies
- Responsive framework – edit child js
- FitVid not working for iframes on particular theme install
- Problems Replacing Background Color with Static Background Image in Responsive Design
- Image menu on responsive WordPress
- How would I use a media query to make my entire theme responsive or fluid? [closed]
- How to make this splash page responsive
- Change featured thumbnail based on screen size
- Hamburger Navigation Menu
- Custom page template not working on mobile
- Hiding site title for Twentyfifteen sidebar on (responsive) desktop display size
- Generate / attach Image srcsets from ACF Image Field
- WordPress site is not loading properly ( showing a min-page)
- wp_get_attachment_image with custom size not rendering possible 2x srcset image