You should not be outputting anything on the wp_enqueue_scripts hook, just enqueueing. Move your css output to a function hooked to wp_head with a lower priority than 8, which is when the enqueued styles are printed in wp_head:
function folio_enqueue_css() {
wp_enqueue_style( 'theme', get_template_directory_uri() . '/assets/css/style.css', false, '1.0', 'all' );
}
add_action( 'wp_enqueue_scripts', 'folio_enqueue_css', 1 );
function folio_dynamic_css() {
ob_start();
echo '<style type="text/css">';
# css styles here
echo '</style>';
# compress CSS
$output = ob_get_clean();
echo preg_replace('/^\s+|\n|\r|\s+$/m', '', $output) ."\n";
}
add_action( 'wp_head', 'folio_dynamic_css', 20 );
Related Posts:
- Could the WP script/style loader be used to concatenate and gzip scripts and styles in the front-end?
- wp_enqueue_scripts, wp_register_scripts, wp_print_scripts: i’m confused
- Use wp_enqueue_scripts, not wp_print_styles?
- How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?
- wp_enqueue_script + how to load JS or CSS in one URL merge call?
- Relative path instead of absolute for wp_enqueue_script
- Custom Admin CSS styles to style media uploader?
- How to insert html/css/javascript code to wordpress plugin
- How to integrate my HTML and javascript into my child theme
- Child theme stylesheet not always overriding “index”
- wp_enqueue_scripts and CSS
- How can I force Dynamic CSS via ACF values to update on page load?
- functions.php – inject inline css from file
- enqueing Javascript and CSS
- Load custom CSS before admin CSS
- Including CSS files in HEAD based on page content
- Dequeue styles with query doesn’t work
- Bootstrap Integtration
- Enqueue CSS and Script only if needeed
- Change Login CSS – Include instead of echo
- Bootstrap 4 Optimization
- plugin not loading my css and js
- How does W3 Total Cache Load Images In Stylesheet via CDN? [closed]
- images within style sheet
- IE and WordPress
- How can I use one stylesheet for multiple sub-sites on my multi-site network?
- How do I apply/target CSS to a specific user role or roles?
- Why is this jquery / java script code not working in mobile / in devices?
- Seperate functions.php for part of site
- Internet Explorer ignore my css
- Enqueuing a script before anything else
- Alternate stylesheet only works with absolute address for link?
- How can I remove the ::after CSS selector which is automaticaly appended to the_content()?
- Hover colour spreading out beyond submit button
- Child Theme CSS not showing at all
- Is it good practice moving the main stylesheets after the plugin styles?
- How to create an optionally available stylesheet for visually impared users?
- Image getting out of container [closed]
- Clients website shows blank page [closed]
- post_class not working with css
- Adding CSS to Blog Posts?
- Where do I go to change the position of the style.css?
- Getting values from options page to css
- Hiding Label via CSS
- Conditionally enqueue a stylesheet based off of a javascript click event
- WordPress 6 – inline container styles breaking my site
- How to make a difference between the portfolio list, and a portfolio item?
- What is the best method to have Dynamic CSS?
- Custom CSS is not working?
- how to stop the shaking effect on my homepage [closed]
- List item images perfect on Chrome/Edge, css fudged on FF/IE [closed]
- Cannot change hover color for links [closed]
- prevent HTML output if custom field is empty [closed]
- Style product detail page with custom CSS in woocommerce
- Using variable to display a page with a different stylesheet
- How can I style an IFRAME element that has a constantly changing class name? [closed]
- Twenty Twelve Calender Widget post titles creating disturbance
- why does this text overlaps in the sidebar?
- Combine CSS Files without plugin
- My site on mobile version is not giving responsive view
- JS button animation for ajax the WordPress style
- Missing “Additional CSS” option in Customizer
- Adding a new block editor color option to a theme
- check the first login for specific roles
- How to make jquery slider to start afresh [closed]
- Trying to make an image a circle in Gutenberg
- How to style a list item when the radio input button within that li is :checked
- Custom CSS based on the Author of a Post
- How to properly hide the div of an inline collapsible button?
- How to remove padding from left&right side
- adding additional class to get the post thumbnail [duplicate]
- How can we create our own formatting style?
- links format change “on clic”
- Web Developer Console: “Slow network is detected.” with fonts
- I can not change the background-color value of wp: meta_value of content.xml
- Problem alignment issue with echo knowledge base
- Complex List Field – Gravity Forms
- Is it better to add to style.css or create your own css when using a template?
- issues with a slider – investigations with firebug
- My custom theme text and content format
- Hide Login Page Labels
- The placeholder text doesnt disappear
- Theme stylesheet not called properly on cloned website
- CSS Changes made, lost mobile functionality
- Content alignment in Twenty Fourteen Theme
- Display different css or Information based on previous page
- Color Picker – Theme options
- Extending site width according to the image size
- How to edit wordpress native gallery’s css file?
- Animate.CSS with a child theme
- a slider menu is compromised in space
- why css doesnt work when i change my file of wordpress and sql to another computer?
- Change Twenty twelve theme background color
- How to change header from full-width to box width
- remove author and date from all posts [closed]
- Add woocommerce plugin in own theme
- Change sidebar product category text color (woocommerce) [closed]
- Suddenly, all links in #content div are not clickable, but I don’t see any z-index bug? [closed]
- Hiding fields a form in via CSS [closed]
- Can physically see CSS changes occur when refreshing page