Set Viewport Meta via PHP Snippet

Hello,

we’re using Divi as our main page builder over on gooloo.de and have seen, that there is missing a header for visually impaired people. This universal PHP Snippet sets the device width as the main width and enables scrolling up to 5x zoom into the page.

Place it anywhere in your functions.php, or via a Code Snippet Plugin.

function add_accessibility_viewport_meta() {
    echo '<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=5">';
}
add_action('wp_head', 'add_accessibility_viewport_meta', 1);

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *