WordPress editor stripping HTML

I have recently switched to the Trusted theme as I preferred the layout to the previous theme I was using.

I am currently trying to add html scripting to one of my pages to add a “show more/less” button. I had difficulty with this in the previous theme but changed to TinyMCE Advanced editor and that sorted the issues.

I am trying to add code of the sort:

<div><input id=”post-1″ class=”read-more-state” type=”checkbox” />
<div class=”read-more-wrap”>
<h2>Header</h2>
<p>Area shown before button</p>
<div class=”read-more-target”>
<p>Hidden Text revealed after button pressed</p>
<p>More Text</p>
<p>Even more text.</p>
</div>
</div>
<label class=”read-more-trigger” for=”post-1″></label>
</div>

Once I save the the HTML, I end up with:

<h2>Header</h2>
<p>Area shown before button</p>
<p>Hidden Text revealed after button pressed</p>
<p>More Text</p>
<p>Even more text.</p>

All of the HTML elements bar and

have been removed which means the show more/less button is not displayed.

As I said, I have added the TinyMCE Advanced editor, I have also added different code to functions.php to solve the issue similar to: what can be seen here.

Nothing has worked. Has anyone had similar issues? any help on this would be great.
As you can see, all but one of my elements have a class attached, I have seen that this is a potential work around but not working for me

Read more here:: WordPress editor stripping HTML

Leave a Reply

Your email address will not be published. Required fields are marked *