Answer the question
In order to leave comments, you need to log in
How can wp_print_styles be moved from wp_head to wp_footer?
I wondered about the topic of optimization, I got stuck at the stage of transferring the connection of styles to the footer of the site ...
Actually, this function clings to default-filters.php
add_action( 'wp_head', 'wp_print_styles', 8 );
remove_action('wp_head', 'wp_print_styles');
function disable_wp_style() {
remove_action('wp_head', 'wp_print_styles');
}
add_action( 'init', 'disable_wp_style' );
Answer the question
In order to leave comments, you need to log in
Try this
function disable_wp_style() {
remove_action( 'wp_head', 'wp_print_styles', 8 );
}
add_action( 'wp_head', 'disable_wp_style', 1 );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question