WordPress – add_editor_style() not adding stylesheets to TinyMCE Editor

Today I had a strange one. I’ve been adding editor styles to my sites using add_editor_style() now for a while, so that editors can see what the posts will look like when they post them. Today when I added in the same code as I always do, the stylesheets just wouldn’t work.

So, I started what every good developer does… debugging from the top down.

First, I checked to see that my code was right. Yep, it was all written correctly, it was in the right place and called by the right action. So, that wasn’t it.

Next, I looked at the TinyMCE window, and that had the stylesheets showing there, so that showed me that they were actually being set up – but the styles on them weren’t showing.

That led me to my “breakthrough”. Browser caching strikes again! That’s all it was. I cleared the cache in my browser, and everything showed up in the fantastic colours and styles that it should.

Again, this just proves that the simplest solution is almost always the correct one!

Leave a Reply

Your email address will not be published.