Skip to content

Instantly share code, notes, and snippets.

@studiopress
Last active January 1, 2020 04:41
Show Gist options
  • Save studiopress/6173519 to your computer and use it in GitHub Desktop.
Save studiopress/6173519 to your computer and use it in GitHub Desktop.
Add viewport meta tag.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add custom Viewport meta tag for mobile browsers
add_action( 'genesis_meta', 'sp_viewport_meta_tag' );
function sp_viewport_meta_tag() {
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
}
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add Viewport meta tag for mobile browsers (requires HTML5 theme support)
add_theme_support( 'genesis-responsive-viewport' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment