I read that I should insert my style.css
file in my theme through the wp_enqueue_style()
function because it’s not a good solution to add that file through a link tag in the html of the header.php
file.
Could you explain me the reasons?
I read that I should insert my style.css
file in my theme through the wp_enqueue_style()
function because it’s not a good solution to add that file through a link tag in the html of the header.php
file.
Could you explain me the reasons?
Three good reasons to use the enqueue functions over hard coding are to eliminate duplication, avoiding library conflicts, and handling dependencies:
wp_enqueue_style()
.Further reading here: https://www.seedprod.com/enqueuing-styles-scripts-wordpress/