To enqueue or not to enqueue

Method 2

  1. You can enqueue all of your stylesheets form the same place even
    controlling where the stylesheets load by means of template
    conditionals, which is convenient and prevents a lot of mess in your <head>.
  2. You can remove enqueued stylesheets if you need to via a plugin, for
    example.
  3. Enqueued stylesheets are child theme friendly as they can be removed
    and replaced.
  4. The style registration/enqueueing system has built in dependency
    handling. See the third parameter of wp_enqueue_style or
    wp_register_style. That means that you can register a dozen
    files and if you assign dependencies correctly you can load them all
    with a single wp_enqueue_style('my-style');.
  5. There is “version” handling via the fourth parameter– not a big
    deal but convenient.
  6. There is also built in “media” handling via the fifth parameter–
    again, not a big deal but convenient.
  7. Plugins or other code can manipulate enqueued stylesheets in ways
    you cannot if you write the code into the template– for example
    (and as already mentioned) some plugins compress and combine
    stylesheets which is very nice if you have a lot of plugins all
    loading stylesheets.

I would count #1, #2, and #4 as the biggest benefits but #3 is very important if you build themes for public consumption that might become a parent, and important if you are trying to build a child.

Leave a Comment