WordPress Losing Divs?

If you’ve recently upgraded to WordPress 2.1 (or 2.1.2), you’ll notice that TinyMCE has stopped allowing <div> tags. This is unfortunate, because they’re the way of the future. Out with the <table>, in with the <div>.

Anyway our content management system (ERA404 CMS) uses TinyMCE, and the best way around this <div> debacle is to just swap line 25 of the tiny_mce_config.php file (located in the js/tinymce/plugins directory) with the following line (make sure it’s only one line with no break):

$valid_elements = '#p[*],-div[*],-strong/-b[*],

Et voila! Your <divs> have returned. I’d obviously recommend saving a back-up of the original config file, just in case you don’t replace the line correctly, but that should do it.

Leave a Reply

Your email address will not be published.