If you are building a theme that you’d like to be mobile responsive, it is important that you add this meta tag to the <head> section of your site so mobile phones know to render it appropriately.
If you are using the Genesis theme framework, you can add this to your theme instead: add_theme_support( 'genesis-responsive-viewport' );
| <?php | |
| /** | |
| * Viewport Meta Tag for Mobile Browsers | |
| * | |
| * @author Bill Erickson | |
| * @link http://www.billerickson.net/code/responsive-meta-tag | |
| */ | |
| function be_viewport_meta_tag() { | |
| echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>'; | |
| } | |
| add_action( 'wp_head', 'be_viewport_meta_tag' ); |