Question

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!

Was it helpful?

Solution

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top