$ss_dir = get_stylesheet_directory(); // Shorten code, save 1 call
ob_start(); // Capture all output (output buffering)
require($ss_dir . '/library/css/dynamic.css.php'); // Generate CSS
$css = ob_get_clean(); // Get generated CSS (output buffering)
file_put_contents($ss_dir . '/library/css/static.css', $css, LOCK_EX); // Save it
Regards.
PS: You cannot be a developer with scratchy files’ skills. They’re not optional.
Related Posts:
- Best practices for a Style/CSS based theme options page?
- How to use media upload on theme option page?
- Add a page outside of the current theme?
- Switch Theme Through Options Panel
- How to make alert for new version on theme options?
- How to mark an option as selected
- How can I show more than 15 themes at a time in the admin menu?
- Does uninstalling a WordPress theme delete its database values?
- Cannot find the code for “Edit This” link in posts in a specific theme
- Defining different theme for Blog posts page
- How to set different settings for a mobile theme?
- Disable Theme API / Front end (for API only environment)
- What’s the proper way to include inlined javascript-source?
- How to understand a specific bit of WordPress syntax
- Should a child theme share the same theme options row as the parent, or should it have it’s own options row?
- Creating a theme options page
- How Do I Use A Custom Mobile Theme?
- How can I make some themes usable only by admins?
- Custom options below pages/posts editor?
- Redux callback action
- Preserve theme settings when migrating from local to live
- Functions containing parameter ‘yourtheme’
- What is the “pub” theme? [closed]
- Passing dynamic options from backend to frontend
- Color Options from Theme Customizer API not returning via get_theme_mod()
- Issue with theme mod options during domain migration
- .PO file is found but I don’t see translations: how to debug the problem?
- How to add some php code in header.php using plugin
- WordPress activate theme error $pagenow
- Setting a new default template for the creation of a page
- Cannot update a file for my theme
- List of categories instead of dropdown menu selector in admin options
- Switching among theme customizations
- how to create a section inside a section with theme options customizer
- Warning: call_user_func() expects parameter 1 to be a valid callback
- Create /archive page in WordPress Theme
- Church hope them issue
- Link to specific Customizer section
- When cropping a header image, retain meta data (i.e. name, description, etc.) from original image?
- How to create a new theme from scratch?
- Adding a Template to the Page Attributes Panel for both Posts and Pages?
- How do you change the theme location?
- How do I put my comment form above the comments?
- How can I check for malware in a Theme? [closed]
- Theme Advanced Styles in Visual Editor and Paragraphs
- Want to have the Post editor remembering the last editing position
- Theme of codinghorror.com
- How to add template to theme in WP
- During theme installation theme upload failed
- Change title slug or separator in WordPress
- How to configure PoEdit to pick up translation string?
- how to remove padding from left and right side? [closed]
- Switching a Site to WordPress and Leaving It Live Until Ready
- Troubles with Walker_Nav_Menu and closing
- Translation not working after editing plugin template
- How to apply different themes with custom design in one site?
- How to make Additional css changes global all across the web pages on WordPress website?
- WordPress without a theme – help!
- Problem Installing a Premium Theme– File Permission Issue on a Mac, Local Machine? [closed]
- Is it good practice moving the main stylesheets after the plugin styles?
- Variant of the same theme for each page
- can’t see aditional themes in control panel
- What’s the default order used by WordPress to load CSS files?
- Alignment Problem [closed]
- How can I remove all traces of a theme?
- Unable to find translations in WordPress theme
- Updating WordPress Theme Files
- A thin line between native wordpress bahaviour and 3rd party themes
- Using filter in the widget causes fatal error
- Display Pointer only once?
- Theme title in admin shows full path [closed]
- Is there a way to see how a theme will look before buying it?
- Menu items do not “open” when mouse hover over them?
- From where wp ecommerce is loading plugin theme files?
- Making first post wider than other posts on home page(default)
- How to push a theme update for a ciustom theme used on multiple independant self hosted sites?
- Removing a widget via theme editor
- theme customizations gone after enabling ssl
- Can’t embed certain youtube videos into theme
- How to customize a section of a widget only on certain pages or page
- How do I get the featured image to sit below the header in the twenty nineteen theme?
- Simple filter to change label name of Email Adress to something else
- Basic wordpress search shows no results
- How do I remove search bar that isn’t a widget?
- Changing theme folder name disrupts widgets
- WordPress Customazation API section in section
- TwentyFourteen Theme : Changing grid layout
- Replacing current theme folder by previous version of the same folder produces “undefined function get_header()” error
- Does not work bookmarklet in the theme Tagology
- How do I block a subdirectory from WordPress theming?
- WordPress two sidebar layout or theme
- How to remove the option data of a theme when that theme is removed?
- Resetting Themes Folder to Default
- How to Hide Blog Post Author?
- Convert theme to be based on Bootstrap?
- Adding a wp_head hook from an included PHP file
- Deleting Widgets in sidebar in Panthea theme
- Static posts page is not working
- Disabling Full Site Editor (FSE)
- get_post_meta() doesn’t allow email