I've found this solution working up to wp 3.2.1 and TinyMCE Advanced 3.4.2.1.
1) Go to Settings -> TinyMCE Advanced and drag&drop the "styles" box over one editor active toolbar, then save changes.
2) Add a css file in your theme folder, for example:
css/extra-editor-styles.css
3) Open your theme functions.php and add code below:
//load extra-editor-styles.css in tinymce
add_editor_style('css/extra-editor-styles.css');
add_filter('tiny_mce_before_init', 'myCustomTinyMCE' );
/* Custom CSS styles on TinyMCE Editor */
if ( ! function_exists( 'myCustomTinyMCE' ) ) {
function myCustomTinyMCE($init) {
$init['theme_advanced_styles'] = 'Style-01-name=css-01-identifier; Style-02-name=css-02-identifier; Style-03-name=css-03-identifier';
return $init;
}
}
where:
- Style-XX-name is one of the option users can choose from in the styles dropdown
- css-XX-identifier is the relative class name that will be added to the selected dom element.
Obviously you can go further and add as many classes you want, using ";" as separator.
4) Insert in css/extra-editor-styles.css all css code relative to all classes you have defined at point 3) and all the defined custom styles will be applied directly in the editor textarea and on front-end.
Hope this can help.
Bye, Daniele.