Title: Using theme options to modify CSS
Last modified: August 19, 2016

---

# Using theme options to modify CSS

 *  [snthr](https://wordpress.org/support/users/snthr/)
 * (@snthr)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/using-theme-options-to-modify-css/)
 * Hi.
 * I had a look around and I couldn’t find an exact answer to this question…
 * I’m making a theme at the moment, and I’m including some theme options. I have
   the basics working, but I need to know the ‘best practice’ ways of doing a couple
   of things.
 * Specifically, I want users of my theme to be able to set their own link colour.
   To do this, I need to re-write the default link colour in my CSS file with whatever
   they want. As far as I am aware, you can’t directly use PHP in a CSS file (not
   without renaming it to something like styles.css.php, which I don’t want to do).
 * A lot of themes allow this ability to set link colours — is there a standard 
   or accepted way that they do this? How do they do it without using PHP in their
   CSS?
 * Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/using-theme-options-to-modify-css/#post-1915961)
 * They use css in their php! It can be printed as inline css using wp_head, which
   allows it to be output in the <head> section of the site
 *     ```
       add_action( 'wp_head', 'voodoo_inline_css', 100000 );
   
       if( get_theme_option( 'custom_css' ) )
       		theme_option( 'custom_css' ); 
   
       	do_action( 'voodoo_inline_css' );
       ```
   
 * I have a custom_css option where users can input the css, then it gets added 
   in
 *  Thread Starter [snthr](https://wordpress.org/support/users/snthr/)
 * (@snthr)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/using-theme-options-to-modify-css/#post-1916381)
 * Thanks for the info.
 * I’m not sure I really understand you, though. The code you posted — where does
   that go? Into functions.php or somewhere like that?
 * How would I add several CSS options for a user to mess with in the theme?
 * Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using theme options to modify CSS’ is closed to new replies.

## Tags

 * [colours](https://wordpress.org/support/topic-tag/colours/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [Themes](https://wordpress.org/support/topic-tag/themes/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [snthr](https://wordpress.org/support/users/snthr/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/using-theme-options-to-modify-css/#post-1916381)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
