How to load scripts/styles specific for a page


I know that according default WordPress boot process, firstly functions.php is called, after that goes all theme stuff.
But I am currently going to refactor my theme completely to optimize it.
My idea is to have one base css file for common properties, normalize, colors.
Or to keep single css file, but in this case I need to hardcode switch case in functions.php in order to determine page.
And another one specific for each page, because this doesn’t make sense to load huge css style file with all styles defined.

So my question is what is the best place to to hook for loading specific script/style ?

Should it be header-xxx.php or another file ? Maybe there is a way to implement this idea in more scalable and elegant way ?

I would be grateful for any help.

, , , , CROSP 2 years 2020-08-10T19:10:53-05:00 0 Answers 45 views 0

Leave an answer