Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WP devs, why would I use wp_register_style?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #156497
    deeve007
    Participant

    Why wouldn’t I simply use “wp_enqueue_style” by itself, rather than register and then enqueue?

    #156506
    Alen
    Participant

    You register style that is not defined in WP. If you want to echo out different stylesheet for example, you register it first… so in your code you can refer to it by its name. Ex. wp_enqueue_style('my-registered-style); It also lets you define any dependencies, so that the system can output those styles as well. You do not need to register default style.css file.

    #156559
    Alen
    Participant

    It’s just the WordPress convention or best practice. If you are developing theme for public consumption make sure to register it, if you’re managing the site your self then you can simply load the stylesheet however it makes sense to you.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.