Contents
What does it mean to enqueue a stylesheet?
If you aren’t familiar with the term “enqueue” it basically means to add data that is awaiting processing into a queue. So with our stylesheets and script files in WordPress, we are adding them to a queue and waiting for the correct moment to use them.
What does it mean to enqueue a script?
Enqueue means to add (an item of data awaiting processing) to a queue of such items.
What dequeue means?
double-ended queue
From Wikipedia, the free encyclopedia. In computer science, the word dequeue can be used as: A verb meaning “to remove from a queue” An abbreviation for double-ended queue (more commonly, deque)
How to enqueue parent theme stylesheet in CSS?
On it, Konstantin pointed out that using the CSS @import directive to import the parent theme stylesheet from the child theme style.css will double the time needed for the stylesheets to load, and showed us a better way to do it by enqueuing the parent theme stylesheet from our child theme’s functions.php file (more about it in a moment).
How to include styles in WordPress child themes?
When added to your Child Theme, this function will include both parent and child stylesheets. Notice that we’re defining the dependency parameter in the child-theme enqueue, array(‘parent-theme’). This tells WordPress that the child styles are dependent on the parent styles, so WordPress will load the parent styles first.
Do you include parent themes in child themes?
Better late than never, so I didn´t want to finish this year without talking about the right way to include the parent theme styles in child themes.
Why does WordPress load the parent styles first?
This tells WordPress that the child styles are dependent on the parent styles, so WordPress will load the parent styles first. This is just a precaution, as the order in which the enqueue functions are called should dictate the correct order.