creating a custom script that writes to the static CSS file is a bad idea!!!
you would need to regenerate the file each time you save any changes.
a better solution would be to save all options in an array of options say for example:
$MyCSS['background_color'] = #009988;
$MyCSS['background_repeat'] = no-repeat;
update_option('theme_settings',$MyCSS);
and that why you only call the “get_option()” function once.
$MyCSS = get_option('theme_settings');
// and use :
echo $MyCSS['background_color'];
and make much less calls to the database and use less resources if you are thinking performance wise.
Related Posts:
- How to mark an option as selected
- Passing dynamic options from backend to frontend
- How To Add New Option Types To Option Tree?
- How to use media upload on theme option page?
- How do I create my own admin button and theme settings page?
- Add a page outside of the current theme?
- Moving WordPress.com theme and widget settings to self-hosted site?
- Multisite: setting theme and options when a new blog is created
- Copying theme from Localhost to Live does not copy all theme settings with it?
- Register theme customizer settings when theme activates [duplicate]
- Switch Theme Through Options Panel
- How to make alert for new version on theme options?
- Add transparency to wordpress color picker?
- How can I show more than 15 themes at a time in the admin menu?
- How to go about pre generating css file with variables from theme options
- Is there a reliable way to keep track of how long a WordPress theme has been active?
- 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
- Working with an Array inside Your Theme Options Array – Multiple Values
- How to set different settings for a mobile theme?
- Add a series of checkboxes to theme options
- 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?
- What’s the order of loading wordpress elements?
- Creating a theme options page
- loss of theme options while site deployment in production
- Theme settings default, strange behavior before first save
- How Do I Use A Custom Mobile Theme?
- How to find out if page_for_posts is showing (in order to style menu item)
- New custom theme option (text input) giving index error
- How can I make some themes usable only by admins?
- Custom options below pages/posts editor?
- Redux callback action
- Full page (no WP admin menus and options) admin theme options
- Preserve theme settings when migrating from local to live
- Functions containing parameter ‘yourtheme’
- How to dynamically change theme’s slogan from admin?
- What is the “pub” theme? [closed]
- Problems to disable the comments for my statics pages
- 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
- WordPress setup one database with two different website?
- How to include stylesheet in custom admin using parent_slug
- Get data from Theme Options and use them into meta options field in custom post type
- Cannot update a file for my theme
- List of categories instead of dropdown menu selector in admin options
- What’s the easiest way of adding more options in the Theme Options of the twenty eleven theme?
- Switching among theme customizations
- How to implement theme option to change bootstrap 4 container from .container to .container-fluid
- how to create a section inside a section with theme options customizer
- Warning: call_user_func() expects parameter 1 to be a valid callback
- Can i add wordpress editor to my custom theme option? [closed]
- Create /archive page in WordPress Theme
- Theme Options Menu Item – Permission Issue
- Church hope them issue
- Is there a way to enable horizontal margin for a specific block element?
- How to change background color in the Notepad++ text editor?
- How to change or add theme to Android Studio?
- WordPress frameworks and parent themes [closed]
- Opinions and recommendations on the best barebones base theme [closed]
- Remove JSON API links in header html
- Using OOP in themes
- Where can I download WordPress themes from? [closed]
- How can I allow the Editor Role to change Theme Settings?
- What are all the available parameters for query_posts?
- get_option() vs get_theme_mod(): Why is one slower?
- Customizing a WordPress theme without changing it?
- Where can I learn to create my own theme?
- How do I turn off self-closing tags for markup in WordPress (for HTML5, or HTML4, for example)?
- how to add version of style.css in wordpress
- Does WordPress work without a theme?
- What is the role and history of the $content_width global variable?
- Adding admin-ajax.php to the frontend. Good or bad idea?
- How to move the sidebar in TwentyFifteen to the right?
- How to Link External jQuery/Javascript files with WordPress
- Installation failed: Download failed. No working transports found
- What is theme-compat?
- Override parent theme translation on child theme
- WordPress Theme activation hook?
- Can wordpress theme folder name be changed freely and nothing technically happens
- Link to specific Customizer section
- What does exactly GPL license mean for my WordPress theme?
- Am I allowed to license my WordPress theme under the aGPL
- WordPress API Menu/Submenu Order
- How do I change the header image height in Twenty Seventeen?
- Starter Theme vs Parent Theme? Pros and cons
- How to change the language for the front-end only?
- W3 Total Cache, CDN and theme files [closed]
- Best way to include Bootstrap in WordPress
- How to set thumbnail image for a (child) theme
- Different template of products for specific category. WooCommerce
- Show different theme for admin?
- How can I version the main CSS file?