Created
September 5, 2023 11:28
-
-
Save Glinkfr/b120cdf4a715846342b616abe4fe7a19 to your computer and use it in GitHub Desktop.
Extra | 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 extra_add_viewport_meta du wp_head | |
function remove_extra_actions() { | |
remove_action( 'wp_head', 'extra_add_viewport_meta' ); | |
} | |
// Appel de 'remove_divi_actions' pendant l'initialisation de WP | |
add_action('init','remove_extra_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 ); |
Hi Bessonweb,
this script is for EXTRA theme and not DIVI, you need to use this script :
https://gist.github.com/Glinkfr/fb77c5aeee77e117117d43b23c0bc965
Oh thank you and sorry for the mistake :-)
Thank you!!
The 'extra_add_viewport_meta' was the last bit of code in the script that I missed!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi and thank you for this script, but it seem not remove the Divi viewport meta tag.
It correctly add the new viewport tag after the first and Google pagespeed Insight is not happy.
Have you a fix please?