X

Visual Editor CSS

If you are building a design that includes div’s in the actual WordPress posts, the WordPress Visual Editor is not even close to beeing WYSIWYG (What You See Is What You Get).

Using this snippet you can add CSS styling to the Visual Editor, and make it easier for the user to change and view the content.

The parameter $your_custom_stylesheet is the name of the stylesheet, relative to the theme root. It also accepts an array of stylesheets. It is optional and defaults to ‘editor-style.css’.

Code Snippet:

<?php
/* Add CSS to Visual Editor. */
$your_custom_stylesheet = 'css/custom-editor-style.css';
add_editor_style($your_custom_stylesheet);
?>

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!