I created an options page for my theme, where I can manually edit the CSS.
Lets say I change the CSS in the options page for the <H1>
tag, so it will now change it on the front-end.
What I want to also do is have it change in the visual editor.
I have added the function
add_editor_style(style.php);
and in the style.php
I have it saying in the top
<?php
header('Content-type: text/css');
?>
so it recognizes the file. But now I can't get the options dynamically...
How should I achieve this?
EDIT
this is in the functions.
add_filter( 'mce_css', 'cnote_visual_css' );
function cnote_visual_css() {
return get_bloginfo('template_directory') . '/cnotethegr8/global-style.php';
}
this is the global stylesheet
<?php
header('Content-type: text/css');
global $shortname;
?>
h1 { <?php echo(get_option($shortname.'_style_h1')); ?> }
when i echo $shortname nothing shows...
style.css
file in the editor, or do you have a problem reading your plugin settings in that file? Can you edit your question to make this clear?add_editor_style("style.php?v=".rand());