queue_css_file — Add a CSS file or files to the current page.¶
queue_css_file($file, $media = 'all', $conditional = false, $dir = 'css', $version = OMEKA_VERSION)¶
Add a CSS file or files to the current page.
All stylesheets will be included in the page’s head. This needs to be called either before head(), or in a plugin_header hook.
- $file (string|array) – File to use, if an array is passed, each array member will be treated like a file.
- $media (string) – CSS media declaration, defaults to ‘all’.
- $conditional (string|bool) – IE-style conditional comment, used generally to include IE-specific styles. Defaults to false.
- $dir (string) – Directory to search for the file. Keeping the default is recommended.
- $version (mixed) – Version number. By default OMEKA_VERSION.
head_css actually outputs the stylesheet markup. All themes should already call
so you can just use the queue functions.
Include the CSS file
style.css located in the
css folder in your theme:
<?php queue_css_file('style'); ?>
Load multiple CSS files using an array:
<?php queue_css_file(array('style', 'screen')); ?>
Load a CSS file and add a media query:
<?php queue_css_file('media/960min', 'only screen and (min-width: 960px)'); ?>