Enqueue CSS in the head instead of footer

50 Views Asked by At

I have a doubt - CSS enqueued using block.json is getting enqueued to the footer, often as inline styles, is there any way to control this behavior so that JS is enqueued in the footer and styles are enqueued in the head?

This is specifically for styles loaded via block.json behavior, not looking to modify the default enqueuing behavior.

Add the contents of the block.json for reference

{
  "apiVersion": 2,
  "name": "acf/product-slider",
  "title": "product slider",
  "description": "A custom product slider block.",
  "style": ["file:./css/product-slider.min.css"],
  "script": ["product-slider.js", "jquery", "slick.min.js-js"],
  "category": "formatting",
  "icon": "admin-comments",
  "keywords": ["product-slider", "product slider", "custom", "matsio"],
  "acf": {
    "mode": "preview",
    "renderTemplate": "product-slider.php"
  },
  "align": "full"
}
0

There are 0 best solutions below