Forums

How To Stop Stripping Div Tags in HTML/Visual Editor (2 posts)

  1. danpoynor
    Member
    Posted 1 month ago #

    In the HTML editor if I enter:

    <div class="mycontent-wrapper">
    <div class="mycontent-top-bar"></div>
    <div class="mycontent">blah blah blah</div>
    <div class="mycontent-btm-bar"></div>
    </div>

    then click on the "Visual" editor tab and back on the "HTML" tab I see:

    <div class="mycontent-wrapper">
    <div class="mycontent">blah blah blah</div>
    </div>

    Why are the "mycontent-top" and "mycontent-btm" div's no longer there? Is this a documented "feature" of WordPress?

    Searching I see other folks have had the same problem but I'm not finding any solutions. Is there a fix or plugin to stop this behavior?

    Thanks,
    DAN

  2. iridiax
    Member
    Posted 1 month ago #

    Is there a fix or plugin to stop this behavior?

    Yes, if you are entering your own code, you can't use the visual editor. Switching back and forth between the visual and html editors will mess up your code, and there is no fix for this other than not doing it.

Reply

You must log in to post.

About this Topic