Skip to content

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.)

(edit: Here’s a place to find out how to use is_mobile)

stuff we dig

FYI: yes, the above are affiliate links, so we do make a small amount of money if you follow them over and buy what they're selling. Thank you for helping pay our hosting costs!

Dave Kuhar

Dave is the jack-of-all-trades running Transmit Studio, a media creation lab in San Jose. He's built more websites than he can remember, well over a hundred of them on WordPress. Whether it's tradeshow booths, video/TV, graphic design, presentations, magazine, tearsheet, and catalog layout, corporate identity packages, or just about any other kind of visual communication project, he's worked on it!

2 Comments

  1. Joe Mendel on September 10, 2012 at 11:47 pm

    Or, as we discovered, we could simply use wp_is_mobile.

  2. Dave Kuhar on September 11, 2012 at 9:09 am

    Turns out we’re not always the sharpest crayons in the box. Still, this code will be handy when we build non-WP sites.

Leave a Comment





Scroll To Top