Skip to content

Instantly share code, notes, and snippets.

@igmoweb
Last active August 29, 2015 14:14
Show Gist options
  • Save igmoweb/ad8cd8a827d88e3e18b0 to your computer and use it in GitHub Desktop.
Save igmoweb/ad8cd8a827d88e3e18b0 to your computer and use it in GitHub Desktop.
Use wp_head to dinamically generate CSS
<?php
add_action( 'wp_head', 'dolly_print_styles' );
function dolly_print_styles() {
$options = get_option( 'my-options' );
?>
<style>
.my-class {
background-color:<?php echo $options['background-color']; ?>;
font-size:<?php echo $options['font-size']; ?>px;
}
</style>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment