Skip to main content
Post Closed as "Duplicate" by fuxia
wp_enqueue_style --> wp_enqueue_script (more common case)
Source Link
Doug
  • 139
  • 1
  • 8

Almost all of my CSS and JS resources can be postponed with an ASYNC or DEFER tag added to the resource. This may improve performance of my page load times considerably. However, I don't know how to specify these attributes to be added to the HEAD when wp_enqueue_style() takes care of adding them. It doesn't seem like wp_enqueue_stylewp_enqueue_script() takes a parameter for extra attributes. Is there another way?

Almost all of my CSS and JS resources can be postponed with an ASYNC or DEFER tag added to the resource. This may improve performance of my page load times considerably. However, I don't know how to specify these attributes to be added to the HEAD when wp_enqueue_style() takes care of adding them. It doesn't seem like wp_enqueue_style() takes a parameter for extra attributes. Is there another way?

Almost all of my CSS and JS resources can be postponed with an ASYNC or DEFER tag added to the resource. This may improve performance of my page load times considerably. However, I don't know how to specify these attributes to be added to the HEAD when wp_enqueue_style() takes care of adding them. It doesn't seem like wp_enqueue_script() takes a parameter for extra attributes. Is there another way?

Source Link
Doug
  • 139
  • 1
  • 8

How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin?

Almost all of my CSS and JS resources can be postponed with an ASYNC or DEFER tag added to the resource. This may improve performance of my page load times considerably. However, I don't know how to specify these attributes to be added to the HEAD when wp_enqueue_style() takes care of adding them. It doesn't seem like wp_enqueue_style() takes a parameter for extra attributes. Is there another way?