Although @Jevuska did solve my issue, I have found a much easier solution to adding dynamic CSS from my theme options page. Here we go!
Add this to functions.php
add_action('wp_head', 'my_custom_css');
function my_custom_css(){
require_once( get_template_directory() . '/css/theme-styles.php' );
}
Now you can treat theme-styles.php as a normal CSS stylesheet
<style type="text/css">
a {
color: <?php echo get_option('some_other_option');?> !important;
}
</style>
Done! It was that simple.
Related Posts:
- Theme Options Page – User Updates Logo
- Selectbox in admin panel function linking to CSS
- Why have on every line
- Function to return true if current page has child pages
- Include a external PHP file into a WordPress Custom Template
- List of all theme customizer control types?
- Get author full name
- How to export/import theme customizer settings?
- How to remove hardcoded characters from playlists?
- reason of splitting theme files to multiple files
- is there a simple way to list every templates / php files used to generate a specific page?
- wp_customize_image_control default value
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- WordPress loop specific thumbnail size
- Is it possible to use the featured image of a page as a css background without inlining?
- Widgets not showing in my custom theme
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- max_input_vars: how many am I using?
- Set WordPress Default Template
- Customizer: Output default value in Customizer CSS
- Set the checkbox as checked by default at options page
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Converting HTML Template to WordPress Theme
- How to use my style.css file outside of wordpress subdomain?
- Can I install/embed WordPress on a ‘single page’?
- Using if/else statements with output from theme options
- Customizer: active_callback and sanitize_callback incompatibility?
- Customize position of social icons in upme plugin [closed]
- Menu jumping when calling it via PHP
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Redirect to another page using contact form 7? [closed]
- Custom Background by Page IDs
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- Underscore – Self hosted fonts
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Warning: Illegal string offset on theme options page [closed]
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- Clickable image link sends people to wrong URL
- How to add drag and drop functionalities to a div inside option panel
- How to modify mobile nav menu text in theme
- jQuery accordion menu
- Is there a hack for using is_page() within the function.php file?
- Assign Custom classes to every Excerpt
- pass html code to worpdress
- Using theme options to change a border-radius value
- Displaying images outside the content
- Dynamically switch file in get_template_directory_uri() | Function [closed]
- Create Columns with Custom Walker and CSS Classes
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- How to print all the inline styles in the WP_Styles instance together with their keys?
- register dependency css and js inside a plugin class
- Fix hover images blink
- custom field – changing an element or background of id div – different versions not working
- CSS loading as empty file in Custom Theme
- How to add Open/Close Toggle button into Twenty Fifteen theme for hiding left sidebar?
- How to get php file based on URL in WordPress
- How can I customize a WordPress theme before it’s downloaded?
- Where can I find the declaration of `$_wp_theme_features`?
- Click to expand menu
- Relative post date in recent posts list
- Display tab title as ‘blog tagline | blog title’
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- wp_customize_image_control default value
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- How to add button to top of theme customizer?
- Not able to call class in NHP framework
- Sidebar doesnt get updated?
- How to change a specific character in a theme option value – replace a space with a plus sign
- Add CSS class to PHP Statement
- Select area and checkbox data is not saving?
- Load slideshow.css file only if Slideshow is checked / on
- Predefine Magazine Style Layouts
- hello can you advise how to fix the error?
- Capture the Selected Radio Button Value between two files in wordpress theme
- zip unzip attachments in wordpress
- Get title attribute from galleries
- How to show an entire post content and not also the excerpt?
- PHP in CSS file?
- WordPress import media error
- Why in my theme I can’t see all the statics content under the posts?
- get_template_directory adding FTP root folders in urls
- Changing the color scheme based on the url visited
- Styling the second sidebar
- Theme not calling Jquery properly
- customize wordpress database error page
- Add class to DIV depending on page loaded
- Display Youtube Time Automate from Key
- Link blogname and blogdescription to the Options Framework
- Liking a facebook page from wordpress website?
- trouble with page_id & highlighting current page
- How can I use a sliced image As banner? [closed]
- Echo title attribute php
- Last class on last headline?
- Creating a blog on my companies new website using WordPress but I have sidebar issues
- Creating a mobile site by adding a new class to the body tag from functions.php
- wordpress admin plugin menu custom css
- How to fix this PHP warning in WP-Admin after upgrading to 3.1.2?