Detect Mobile Browser and Serve Up Alternate Content (or nothing)
The site we just built for faithandform.com has a pretty cool slideshow feature on the home page, serving up a portion of the four most recent issues’ cover images and tables of content. But it doesn’t work well at all on small mobile devices, so Joe and I spent some time poking around the tubes until we worked this out:
Which is all based on a post we found here. (link is now dead)
(You’re going to need this file, too.)
Or, as we discovered, we could simply use wp_is_mobile.
Turns out we’re not always the sharpest crayons in the box. Still, this code will be handy when we build non-WP sites.