4

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!

Jeromy French
  • 11,812
  • 19
  • 76
  • 129
Fostah
  • 2,947
  • 4
  • 56
  • 78

1 Answers1

4

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?

Community
  • 1
  • 1
aendra
  • 5,286
  • 3
  • 38
  • 57