queue_css_string — Add a CSS string to the current page.

Asset-related functions

Summary

queue_css_string($string, $media = 'all', $conditional = false)

Add a CSS string to the current page.

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

Parameters:
  • $string (string) – CSS string to include.
  • $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

Examples

Use together with head_css to load css styles into the page head within <style></style> tags:

<?php queue_css_string("input.add-element {display: block}"); ?>

<?php head_css(); ?>