Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nextab/5760e8043e763e9bb9b51d341b82e5ec to your computer and use it in GitHub Desktop.
Save nextab/5760e8043e763e9bb9b51d341b82e5ec to your computer and use it in GitHub Desktop.
Divi by Elegant Themes is a WordPress theme with a catch: You can't pinch zoom your website. This is not in accordance with WCAG standards, but you can change it very easily with this quick snippet for your child theme's functions.php.
function nxt_remove_et_viewport_meta() {
remove_action('wp_head', 'et_add_viewport_meta');
}
add_action('after_setup_theme', 'nxt_remove_et_viewport_meta');
function nxt_enable_zoom() {
echo '<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0, minimum-scale=0.1, maximum-scale=10.0">';
}
add_action('wp_head', 'nxt_enable_zoom');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment