Get the plugin from wordpress.org.
Update 4: Plugin now hosted at wordpress.org.
Update 3: New version with support for viewport constants, and iPod Touch.
Update 2: James Craig points out that the ID attribute is not allowed in the META element, so I’ve updated the plugin.
Update: I should add what my aim is. Rather than creating a separate template for mobile, I want to have a theme that ‘does the right thing’ for iPhone and desktop browsers.
Some documentation:
- Plugin tests user agent string.
- If it contains ‘iPhone’ then it adds
<meta content="width=480; maximum-scale=0.6667" name="viewport"/>to the document’s head. - It also adds iPhone specific CSS rules. For that reason, you should call wp_head() in your theme file after you declare your default CSS files.
- These rules were written with Sandbox in mind. You will want to edit the CSS rules to suit your theme.
- You can force the viewport and CSS rules by adding
forceiphone=yto the query string portion of a URL.
- If it contains ‘iPhone’ then it adds
- Adds a boolean function:
weh_is_iPhone().- Returns true if user agent string contains ‘iPhone’.
- You can call this function from your theme to add or turn off generation of markup.
- Most likely you’ll use it to turn off generation of sidebars.
Possibly Related posts (machine generated):