If you look at the source code, you can see that wp_enqueue_style( 'crayon' )
is called in Crayon::enqueue_resources()
which itself is called either from either Crayon::the_content()
or Crayon::wp_head()
. The code in Crayon::wp_head
is:
if (!CrayonGlobalSettings::val(CrayonSettings::EFFICIENT_ENQUEUE) || CrayonGlobalSettings::val(CrayonSettings::TAG_EDITOR_FRONT)) {
CrayonLog::debug('head: force enqueue');
// Efficient enqueuing disabled, always load despite enqueuing or not in the_post
self::enqueue_resources();
}
Which will enqueue the style only when certain settings are enabled. Otherwise, the style will only be enqueued from the_content
filter which fires after wp_head
has already been output.
So your two options are:
- Have the CSS enqueued on all pages in the header
- Have the CSS enqueued only on necessary pages but in the footer
Related Posts:
- Trouble understanding apply_filters()
- How many filter/action hooks are healthy?
- Earliest hook to reliably get $post/$posts
- What does (10, 2) mean when used with add_filter
- Valid characters for actions, hooks and filters
- How to check if a hook is hooked or not?
- How to make post and comment count unclickable with dashboard_glance_items hook
- Hook into admin post list page
- Anyway to edit the titlebar of WordPress Widgets in the Admin area?
- About Hooks and Filters
- Should I use add_action(‘publish_post or add_filter(‘publish_post?
- Please explain me what the do_action does
- Too many actions/filters!
- How to get list of all hooks of current theme / plugin?
- How does WordPress call functions attached to a certain action hook before calling functions attached to other hooks
- Conditionally call add_action depending on post_type?
- Is it possible to track down Actions and Filters?
- When to use actions and when to use filters
- Same Conditionals Not Working on Two Different Hooks
- How to call a function or method that is Namespaced using another plugin
- add filter login_redirect does not contain original requested redirect
- get_header and hook avoid normal call
- Can the wp_filter object hold multiple values with the same key
- How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?
- apply_filters/do_action tag characters limit
- Filter taxonomy admin pagination
- Insert term when page is published – avoid duplicates after edits
- Capture post content before page renders
- How to remove action with slashes and arrows?
- Changing WordPress core without hacking core
- Comment search plugin
- Proper after_setup_theme and wp_head cleanup
- How to get a single hook from wp_head()?
- How can I output all apply_filters and do_action?
- Remove actions/filters that are set with create_function()
- Get The Caller (Plugin / Theme / Core) For All actions & Hook in WordPress
- Remove tags without a specific meta key from “choose from the most used tags”
- How to access page variable inside action hook
- What is the action hook to use if you want to capture the new password during password change?
- Use has_filter on comment_post
- How can I edit comment meta value before it is saved?
- Action hook to control access to certain parts of my site
- Replace Data In Post & Update Meta Field Post Is Saved
- Scanning for custom embed and prefetching
- style_loader_tag not changing stylesheet to preload
- Hook to change the site URL
- Hook to add content after date in post?
- Hook inside a hook
- Can you call a filter hook by “add_action”?
- How do filters and hooks really work in PHP
- Is it possible to use object in add_action?
- Filter hook before create order WooCommerce
- apply_filters() slices away needed arguments
- How to add attribute to output with wp_video_shortcode add_filter
- PHP5, Inheritance, Singleton – action & filter hook limitations
- Is it possible to Hook/Filters Attachment Creation?
- Apply the_title filter to post titles AND backend auto social-sharing plugin, but not nav menu
- How to hook some Unicode texts into calendar widget safely?
- How to add attributes to tag when template cannot be directly modified
- how to change appearence of the content of default post list columns?
- WordPress tag cloud add more links
- Yoast SEO hooks overriding themselves
- How can i do something after head like adding a hook for after head but before post
- How to change currency programmatically on creating order action?
- action hook wp_head higher priority as all other plugins/hooks
- Removing an action, or dequeueing style – Both not working
- Change username before login
- Shortcodes — Using add_action, add_filter in the shortcode
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- Building a request processor for multi-page forms, etc using $_GET requests
- How to know what filter to use and how to use it?
- What hooks to hook onto for automatic cache clearing
- Modify Redux Framework Options in Child Theme
- How to customize category_description()?
- How to allow code block in wordpress comments
- remove_action: how to access to a method in an child class?
- Set default value for “Additional CSS class(es)” for specific block types
- Add Different Actions To Different Page’s wp_footer
- How to add a filter to the get_body_class function?
- Hook add_attachment error
- How to override include_once pointed file using add_filter?
- How to find list of all functions bind to a particular hook from my plugin?
- Register new user, assign custom role then send email
- What is the action or filter for adding information under the Permalink in Edit Post/Page?
- output custom Posts on a Page
- Add an attribute to the root from functions.php with add_filter
- Would like to use hook or filters to customize email templates
- add_action with associative array
- Remove image of srcset
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- wp_editor customization
- Passing a parameter to filter and action functions
- What problems could happen if I replaced add_filter and add_action with the function calling
- Adding to an array & passing it through do_action/apply_filters
- Removing action from template class
- Is it possible to make get variable out of filter in Class?
- NextGEN Gallery: Adding drop-down menu widget to gallery view without modifying plugin code [closed]
- How do you disable the verification process of user email changes?
- Ninja Forms: Front-End Forms, Post ID?