public
Last active

Add Viewport meta tag to the head of your site using the Genesis Framework.

  • Download Gist
functions.php
PHP
1 2 3 4 5 6 7 8 9 10 11
<?php
//* Do NOT include the opening php tag
 
//* Add Viewport meta tag for mobile browsers (requires HTML5 theme support)
add_theme_support( 'genesis-responsive-viewport' );
 
//* Add custom Viewport meta tag for mobile browsers
add_action( 'genesis_meta', 'bg_viewport_meta_tag' );
function bg_viewport_meta_tag() {
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.