solostream

How to add styles and buttons to the WYSIWYG Visual Editor in WordPress

| May 16, 2010 | 6 Comments

The Visual Editor in WordPress is great for clients. It lets them feel comfortable adding content with Word-like buttons that they are familiar with.

But, what happens when they want more font styles?

Although you can find plugins that add Quicktags to the HTML view Editor, such as Oren Yomtov’s Post Editor Buttons Plugin, I wanted to make adding content as easy as possible for clients by putting the extra styles in the visual editor instead.

I wanted to add one style to the list of default format styles: h1, h2, etc. but every time I tried some new code in my functions.php, it just wouldn’t show up correctly.

And then I gave in and saw what the massive TinyMCE Advanced plugin had to offer. I was hesitant to use it since it has so many options and I just needed to add one style but it turned out to be a quick and really easy way to add styles to the Visual Editor.

How to add custom styles to the TInyMCE Advanced Plugin:

  1. After you activate the plugin, go to the settings page and drag and drop the Styles dropdown to the row of buttons above.
  2. Go to the plugin files and in the CSS folder, open the tadv-mce.css file. Follow the examples that are there and add your styles to the list. It then looks to your theme’s stylesheet for the style definition.
  3. The styles then show up in the Styles dropdown in the Post or Page Visual Editor!
0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Tags: , , ,

Category: WordPress as CMS

About Rebecca Markowitz: Rebecca Markowitz has built over 40 WordPress sites for clients as Web Marketing Manager and WordPress specialist at illuminea. illuminea is a Jerusalem-based boutique web agency. WPGarage shows my dedicated relationship with WordPress over the years - full of love, laughs, tears, growth and strong drinks. L'chaim! View author profile.

Elegant WP Themes

Comments (6)

Trackback URL | Comments RSS Feed

  1. Rilwis says:

    If we use WP 3.0, we can customize CSS style of post editor by using new function add_editor_style(). It will look for a file editor-style.css in theme folder and apply CSS rules for TinyMCE.
     

  2. Rebecca says:

    Rilwis,
    That is such an awesome feature for 3.0. Good thinking by the WP developers!

  3. Curtis says:

    Rebecca, Thanks!  Nice tutorial! 

    Hey will that custom CSS file be overwritten when there is a plugin update? 

  4. Hoore says:

    Success everybody with your wordpress!

  5. WP Themes says:

    Thanks for this article. I’m still having some issues adding custom styles, but am continuingg to play around with it.

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.

More in WordPress as CMS (3 of 23 articles)