Skip to content

Instantly share code, notes, and snippets.

@Glinkfr
Created September 5, 2023 11:25
Show Gist options
  • Save Glinkfr/fb77c5aeee77e117117d43b23c0bc965 to your computer and use it in GitHub Desktop.
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
<?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