Enqueue Styles or Use Link in Head to load my css quickly in wordpress

[ad_1]

function add_custom_css_to_head() { echo '<link rel="stylesheet" type="text/css" href="' . get_template_directory_uri() . '/assets/css/style.css">'; } add_action( 'wp_head', 'add_custom_css_to_head' );

function enqueue_custom_styles() { wp_enqueue_style( 'style', get_template_directory_uri() . '/assets/css/style.css', array(), NULL ); } add_action( 'wp_enqueue_scripts', 'enqueue_custom_styles' );

Which will load faster ?

My css file is 3000 lines long and not minified

Problem faced: My HTML reders first and css loads significantly late, that made pure html visile to users

[ad_2]
1 Comment

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer