Use this simple code to enable mobile pinch zoom on a Divi WordPress website…
Add this code (from the Elegant Themes website) to the Functions.php file of your child theme.
//Mobile Pinch Zoom
function remove_my_action() {
remove_action(‘wp_head’, ‘et_add_viewport_meta’);
}
function custom_et_add_viewport_meta(){
echo ‘<meta name=”viewport” content=”width=device-width, initial-scale=1.0, maximum-scale=3.0, user-scalable=1″ />’;
}
add_action( ‘init’, ‘remove_my_action’);
add_action( ‘wp_head’, ‘custom_et_add_viewport_meta’ );
Try it on this very webpage 😉
DESIGN TIP
Enabling mobile pinch highlights the need for decent quality images on your website – using well-optimised files and decent compression plugins will help.



