Si te gusta el WPO estos dos comandos te encantarán permitirá extraer la información del id de las hojas de estilos y librerías js con el fin de poder optimizar su cargar y quitar estilos que no necesitemos.

Exencial para los buenos WPO

function se_inspect_styles() {
    global $wp_styles;
    echo "<h2>Enqueued CSS Stylesheets</h2><ul>";
    foreach( $wp_styles->queue as $handle ) :
        echo "<li>" . $handle . "</li>";
    endforeach;
    echo "</ul>";
}
add_action( 'wp_print_styles', 'se_inspect_styles' );

function se_inspect_scripts() {
    global $wp_scripts;
    echo "<h2>Enqueued JS Scripts</h2><ul>";
    foreach( $wp_scripts->queue as $handle ) :
        echo "<li>" . $handle . "</li>";
    endforeach;
    echo "</ul>";
}
add_action( 'wp_print_scripts', 'se_inspect_scripts' );

Posteriormente en nuestro function.php podremos colocar elementos para desactivar las css

add_action( 'wp_print_styles', 'deregister_my_styles', 100 );
 
function deregister_my_styles() {
	wp_deregister_style( 'elementor-pro' );
	wp_deregister_style( 'cookie-law-info' );
	wp_deregister_style( 'cookie-law-info-gdpr' );
	wp_deregister_style( 'elementor-animations' );
	wp_deregister_style( 'elementor-frontend' );
	wp_deregister_style( 'elementor-global' );
	wp_deregister_style( 'Global_CSS' );
	}

Por admin

Deja una respuesta

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock