$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
- Using OOP in themes
- How can I allow the Editor Role to change Theme Settings?
- Undefined offset: 0 in > […] /wp-includes/capabilities.php on line 1067
- Best practice way to implement custom sections into a WordPress theme
- Editing Links in the Footer of WordPress Themes with Base64 Encrypted Code?
- register_theme_directory and broken deploys
- switch a theme different per user role
- Can we create a child theme for a premium child theme built on Genesis framework?
- Migrating October CMS to WordPress
- Delete database tables on theme uninstall?
- Why are my sidebars not registering in unit tests
- How do I apply my CSS to a theme page?
- How do you get thumbnails to show up in the admin edit post?
- Parallax WordPress theme without hardcoding – possible?
- Embedded Videos (PB) – Not Available
- none of my css is working in my child theme
- Finding wordpress file in theme editor using the theme name
- Displaying a widget in sidebar only when no other widgets rendered?
- Search form not finding content in template page
- Buddypress User Settings template location? [closed]
- How to code static pages in WordPress
- Theme, WordPress Version, MySQL Version, PHP Version Update affected files and folders
- Can “Classic Editor” plugin help to replicate the old website / theme development experience from c. 2011?
- Creating custom meta box throws PHP warning error in WordPress
- What is the point of needing add_theme_support( ‘html5’) in WordPress 5.x
- How to display footer menus in wordpress
- Debugging in WordPress at Theme installation [duplicate]
- understanding theme hierarchy
- wp_enqueue_style $dep argument does nothing?
- Posts as filtered list – expandable
- How to remove current theme customizations
- Create QuickStart Package for WordPress just like in Joomla
- After installing a free theme, my wordpress turns into text mode when accessing remotely
- Jquery Theme Roller to WordPress
- Implementation of language_attributes function
- why is this script not working on my site
- is theme network enabled?
- Pharmacare theme login page / login modal redirection to custom URL
- theme installation not working
- wordpress-theme 2017: featured image behaviour: where to set the height of the featured image?
- Changing a parent theme safely
- Trying to create a child theme with plugin
- Own Theme custom CSS does not display in editor but works in page
- Remove Read More Buttons
- Theme-based character encoding issue
- Linkedin not returning right info
- how to load rtl.css file before style.css [duplicate]
- CSS/JS is not working in multi lang installation
- Error while downloading WordPress themes
- Theme stops media uploader from working
- Theme automatically inserting “more” tag on every post
- div having different appearances in different themes
- Satoshi WordPress Theme – Portfolio SetUp Issues
- Page structure using The Customizer Api
- theme 2016 – customize css – nothing happens
- Can’t upload the theme
- Divi theme including javascript
- Installing themes from an external website [closed]
- Best Practice Jumbotron Image for WordPress ~ Responsive
- How to make a page extend full screen [closed]
- Should you directly edit Template Parts and Templates from themes?
- Remove ALL HTML from single page
- Disabling Full Site Editor (FSE)