Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to use my own styles.css for inside the body of the visual editor for my pages. However, when i add

add_editor_style('styles.css');

to the functions.php page it doesnt change anything (font color, boldness, etc) inside the body of the visual editor.

I use firebug and check to see if it even loaded the styles.css and i can not find that it has anywhere.

What am i missing? Do i have to install tinyMCE for this to even work or does this work with the stock visual editor?

Thanks,

David

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

You don't have to specify a file for the editor style. Just use add_editor_style(); in your functions.php, and then create a file called editor-style.css in your theme folder. You may want to look at some examples (e.g. Twenty Eleven) for some of the TinyMCE-specific rules, which is the stock visual editor you're referring to.

share|improve this answer
    
But the styles.css is the file i told to load up? –  StealthRT Sep 7 '11 at 17:33
1  
Are you sure it's styles.css and not style.css? Perhaps try using editor-style.css to see if it works at all. Also, be aware that TinyMCE has some pretty specific stuff it wants, and that if you have your CSS declared using IDs or classes, they are not going to show up even if the CSS file is loaded, as TinyMCE does not load in your theme's structure. –  helenhousandi Sep 7 '11 at 17:39
    
Thanks. It was reading from editor-styles.css as well that was overwriting my own styles.css! :o) –  StealthRT Sep 7 '11 at 18:05
add comment

The CSS file must be called...

editor-style.css

for TinyMCE / Wordpress (Im not sure which) to play nice. Oddly enough using another name will work for some of the styles. I was using "style-editor.css" and it would show the color of the class (depending on what else was in the class), but not the font size. I switched to "editor-style.css" and now its working perfectly.

Thank you helenhousandi for inspiring me to try this.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.