Fostah
Fostah

Reputation: 2946

Wordpress Admin: Adding css styles to Rich text editor drop down

Hey does anyone know how to add your own custom css classes to the Wordpress admin rich text editor drop downs?

When editing a post you see the drop downs to format the selected text to be a paragraph, address or h3 tag. What would be the proper way to add an option "Highlight" that would change the selected text from:

selected text

to:

<span class="highlight">selected text</span>

Thanks!

Upvotes: 4

Views: 4786

Answers (1)

aendra
aendra

Reputation: 5346

If you're using WP3, try using the following function in your theme's functions.php file: http://codex.wordpress.org/Function_Reference/add_editor_style

More detailed instructions:

http://wordpress.org/support/topic/how-to-use-new-add_editor_style-function

Related SO question: How do I use new add_editor_style() function in wordPress?

Upvotes: 4

Related Questions