# Adding custom styles to TinyMCE editor

**URL:** https://discourse.roots.io/t/adding-custom-styles-to-tinymce-editor/2835
**Category:** uncategorized
**Created:** 2015-01-30T10:25:11Z
**Posts:** 6

## Post 1 by @aitor — 2015-01-30T10:25:11Z

Hi, I’m trying it, [as can be seen in the codex](http://codex.wordpress.org/Function_Reference/add_editor_style), adding this line to functions.php:

```
add_editor_style( 'assets/css/txt-styles.css' );
```

And adding a css file with my own classes:

```
assets/css/txt-styles.css
```

But, nothing happens! TinyMCE editor seems do not changed. What I’m doing wrong? There is an specific way to do it in roots?

Thank you.

---

## Post 2 by @aitor — 2015-01-30T17:07:16Z

I found another way to add styles. It works:

> **[Adding Custom Styles in WordPress TinyMCE Editor](https://code.tutsplus.com/tutorials/adding-custom-styles-in-wordpress-tinymce-editor--wp-24980)**
>
> If you are creating a WordPress theme to power a website that will be updated by individuals without any knowledge of HTML, you can add custom styles to the visual TinyMCE editor and ensure that...

So, forget this thread, please.

---

## Post 3 by @cfx — 2015-01-30T17:34:32Z

Use [Roots’s built in `editor-style.css`](https://github.com/roots/roots/blob/master/assets/css/editor-style.css). It gets loaded here: [https://github.com/roots/roots/blob/master/lib/init.php#L35](https://github.com/roots/roots/blob/master/lib/init.php#L35)

---

## Post 4 by @aitor — 2015-02-01T09:19:23Z

How should I use it? I have one style in **/assets/css/editor-style.css**

Something like this:

```
/ **These styles are used in your backend editor.** /

.style {
    background-color: black;
}
```

But nothing happens (there is no new dropdown menu in TinyMCE editor).

I have seen that editor-style.css is originally located at root theme dir. I dont know why, since init.php point to **/assets/css/**.

---

## Post 5 by @cfx — 2015-02-01T15:48:52Z

Your original post was not clear… I thought you simply wanted to style certain text/tags within the editor.

If you want to add custom style options as dropdown items within the TinyMCE editor then see this Codex article: [http://codex.wordpress.org/TinyMCE\_Custom\_Styles](http://codex.wordpress.org/TinyMCE_Custom_Styles).

---

## Post 6 by @aitor — 2015-02-02T18:46:10Z

I’m sorry. My english is very low level!

I can see that your link to codex show the same solution I found (post it in second message of this thread). This tells me that is the correct way to do it!

Thank you very much.
