I am trying to understand how wordpress works, but I am having issue understanding how
wp_enqueue_script() works in relation to page output.
From my understanding, these functions do not output anything to the page until the template have been loaded because the template might want to register a style/script.
Going through wordpress themes files, I've noticed that most of them use
So, how does wordpress manage styles, when a particular template might register a style at the end of the theme. Remember that, css styles are always at the top, so logically
wp_enqueue_style should have been called or am I the one being illogical?