A wordpress website, to improve the performance of google pagespeed, moved all styles and scripts to the footer using this code:
function footer_enqueue_scripts(){ remove_action('wp_head','wp_print_scripts'); remove_action('wp_head','wp_print_head_scripts',9); remove_action('wp_head','wp_enqueue_scripts',1); add_action('wp_footer','wp_print_scripts',5); add_action('wp_footer','wp_enqueue_scripts',5); add_action('wp_footer','wp_print_head_scripts',5); } add_action('after_setup_theme','footer_enqueue_scripts'); which is added to functions.php .
In the code inspector, all styles and scripts in the footer.
As a result, it worked on mobile phones, i.e. Pagespeed does not produce optimization suggestions "Remove the JavaScript and CSS code that blocks the display of the top of the page."
But on the desktop version there is this proposal, i.e. it turns out on the mobile version, the styles and scripts have moved to the footer, but not on the desktop version.
Although if you look in the code inspector, all styles and scripts in the footer.
How can this be? Why when all styles and scripts in the footer, for pagespeed, they are still in the head?
For mobile phones figure 75, for desktop 45