queue_css_url — Add a CSS file to the current page by URL.

Asset-related functions

Summary

queue_css_url($url, $media = 'all', $conditional = false)

Add a CSS file to the current page by URL.

The stylesheet link will appear in the head element. This needs to be called either before head() or in a plugin_header hook.

Parameters:
  • $url

  • $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.

Usage

head_css actually outputs the stylesheet markup. All themes should already call head_css themselves, so you can just use the queue functions.

If writing a theme, queue_css_* functions must be called before the call to head_css. If writing a plugin, you make these calls within the admin_head or public_head hooks.

Examples

Use to load in external stylesheets, such as Google Fonts.

<?php queue_css_url('http://fonts.googleapis.com/css?family=Raleway:400,600'); ?>

See Also