By default, the Divi Theme disables pinch zooming on mobiles. If you'd like to enable pinch zooming, you can either use a plugin such as Definitely allow mobile zooming, or use the following PHP code:
add_action('after_setup_theme', 'db_remove_et_viewport_meta');
add_action('wp_head', 'db_enable_pinch_zoom');
function db_remove_et_viewport_meta() {
remove_action('wp_head', 'et_add_viewport_meta');
}
function db_enable_pinch_zoom() {
echo '<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0, minimum-scale=0.1, maximum-scale=10.0">';
}
Related Post: Adding PHP to the Divi Theme
Both the plugin and the PHP code add a "meta tag" to the source code your web pages which instructs mobile devices to enable pinch zooming.
A slight benefit of the PHP code over the plugin is that it will also remove the meta tag Divi adds to prevent pinch zooming, and thus avoid having an unnecessary extra meta tag showing up in the source code.
0 Comments