Div tags disappearing in my Wordpress Code View
I was having this issue, and I finally took the time to figure out why and what to do about it today. I searched the support forums and this is the post that I found that solved all of my problems.
Tiny MCE as configured in WordPress 2.1 wipes away divs and replaces them with p tags.
This can be fixed by doing the following:
1-Open your TinyMCE config file in an editor. The file is located at:
wp-includes/js/tinymce/tiny_mce_config.php2-Replace Line 25 with the following but on a single line:
$valid_elements = ‘#p[*],-div[*],-strong/-b[*],-em/-i[*],-font[*],-ul[*],-ol[*],-li[*],*[*]‘;
3-Save the file back to your active WordPress installation, overwriting the existing tiny_mce_config.php file.
4-In WordPress admin, the editor will now allow divs.
You may have to refresh your editor page.
As always, copy your original tiny_mce_config.php file to a safe place for backup before editing the original.
I had noticed that any div’s I put in the code view of Wordpress were converted to “p” tags. With this change I should be able to more easily add in my graphical movie reviews, the last major section of my blog left to transfer.
Here are some similar arcade posts
- Wordpress 2.3 Release Candidate 1 (RC1)
- Homesite Installation and first impressions
- Commenting not working
- Moving a Wordpress website
- How can I create HTML email templates using Entourage in OS X.
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.











Comments
No comments yet.
Leave a comment