WordPress Function to Add custom styles to TinyMCE editor

Add custom styles to TinyMCE editor

Sometimes users and clients get confused about how their content is displayed in the editor versus how it is displayed on the front-end. Copying just a few relevant lines from your main stylesheet into your new tinymce.css can help a lot:

function custom_mce_css($wp) {
    return $wp .= ',' . get_bloginfo('stylesheet_directory') . '/css/tinymce.css';
}
add_filter( 'mce_css', 'custom_mce_css' );

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *