Difference between revisions of "WordPress file queue"
From Wiki @ Karl Jones dot com
Karl Jones (Talk | contribs) (Created page with "In WordPress, the '''WordPress file queue''' is how WordPress loads files for external CSS and JavaScript. == Description == == Custom style sheet == See WordPress c...") |
Karl Jones (Talk | contribs) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 3: | Line 3: | ||
== Description == | == 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 <code>wp_enqueue_style()</code> function. | ||
See [[WordPress custom style sheet]] for an example of adding a custom CSS file into the queue. | See [[WordPress custom style sheet]] for an example of adding a custom CSS file into the queue. | ||
Latest revision as of 07: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.