Responsive Meta Tag

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' );
view raw functions.php hosted with ❤ by GitHub

responsive

Bill Erickson

Bill Erickson is a freelance WordPress developer and a contributing developer to the Genesis framework. For the past 14 years he has worked with attorneys, publishers, corporations, and non-profits, building custom websites tailored to their needs and goals.

Ready to upgrade your website?

I build custom WordPress websites that look great and are easy to manage.

Let's Talk