Created
September 5, 2023 11:25
-
-
Save Glinkfr/fb77c5aeee77e117117d43b23c0bc965 to your computer and use it in GitHub Desktop.
Divi | meta viewport maximum-scale à 5 pour améliorer votre score d'Accessibilité dans PageSpeed Insights
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Merci à Garconis : https://gist.github.com/Garconis/34b6be24ee644c024663ef1d2e11e2bb | |
// Supprime et_add_viewport_meta du wp_head | |
function remove_divi_actions() { | |
remove_action( 'wp_head', 'et_add_viewport_meta' ); | |
} | |
// Appel de 'remove_divi_actions' pendant l'initialisation de WP | |
add_action('init','remove_divi_actions'); | |
// Ajout du nouveau pinch et zoom avec le maximum-scale à 5 | |
function et_new_viewport_meta(){ | |
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.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