Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yratof/1d9e8e074de95448a295825cd91b3652 to your computer and use it in GitHub Desktop.
Save yratof/1d9e8e074de95448a295825cd91b3652 to your computer and use it in GitHub Desktop.
Divi | Add pinch and zoom (user scalable) to mobile viewport meta
<?php
// Removes et_add_viewport_meta from the wp_head phase
function remove_divi_actions() {
remove_action( 'wp_head', 'et_add_viewport_meta' );
}
// Call 'remove_divi_actions' during WP initialization
add_action('init','remove_divi_actions');
// add ability to pinch and zoom
function et_new_viewport_meta(){
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=1" />';
}
add_action( 'wp_head', 'et_new_viewport_meta', 15 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment