Difference between revisions of "WordPress file queue"
From Wiki @ Karl Jones dot com
Karl Jones (Talk | contribs) |
Karl Jones (Talk | contribs) |
||
Line 4: | Line 4: | ||
Files must be added to the queue in order for WordPress to use them. | Files must be added to the queue in order for WordPress to use them. | ||
+ | |||
+ | The queue has an order: first file, second file, etc. | ||
+ | |||
+ | == Dependencies == | ||
+ | |||
+ | Often files have '''dependencies'''. | ||
+ | |||
+ | Example: '''File A''' must appear before '''File B'''. | ||
+ | |||
+ | We say that "'''A is a dependency''' of B", or "'''File B is dependent on File A'''". | ||
+ | |||
+ | This can go further: A is dependency of B, B is a dependency of C, etc. | ||
+ | |||
+ | It can also happen that a file is dependent on two or more other files. | ||
+ | |||
+ | == Adding files to queue == | ||
Add files to the queue using the <code>wp_enqueue_style()</code> function. | Add files to the queue using the <code>wp_enqueue_style()</code> function. |
Latest revision as of 06:20, 29 September 2016
In WordPress, the WordPress file queue is how WordPress loads files for external CSS and JavaScript.
Description
Files must be added to the queue in order for WordPress to use them.
The queue has an order: first file, second file, etc.
Dependencies
Often files have dependencies.
Example: File A must appear before File B.
We say that "A is a dependency of B", or "File B is dependent on File A".
This can go further: A is dependency of B, B is a dependency of C, etc.
It can also happen that a file is dependent on two or more other files.
Adding files to queue
Add files to the queue using the wp_enqueue_style()
function.
See WordPress custom style sheet for an example of adding a custom CSS file into the queue.