ok bro lets do it
in the main file of the plugin you must register the setting for the css field
how
register_setting('settings-group', 'css_field');
And then in your settings file, where you create the settings form (e.g. setting.php)
<textarea cols="50" rows="20" name="css_field" id="css_field" tabindex="1"><?php echo get_option('css_field') ?></textarea>
Then call it in the template under get_header();
<style type="text/css">
<?php echo get_option('css_field'); ?>
</style>
or you can add a header to the main file of the plugin. Like:
function wp_css_custome(){
?>
<style type="text/css">
<?php echo get_option('css_field'); ?>
</style>
<?php
}
add_action('wp_head','wp_css_custome');
Hope this helps you :)
source
share