I am still having issue with this.
When I enter this:
<div align="center" id="frontpage-menu">
<a href="/organic-farm-to-table-menu/#Vegan"><h4>Vegan</h4></a>
<div class="divide"></div>
<a href="/organic-farm-to-table-menu/#Jerk"><h4>Jerk</h4></a>
<div class="divide"></div>
<a href="/organic-farm-to-table-menu/#Pasta"><h4>Pasta</h4></a>
<div class="divide"></div>
<a href="/organic-farm-to-table-menu/#Seafood"><h4>Seafood</h4></a>
<div class="divide"></div>
</div>
It changes it to this:
<div id="frontpage-menu" align="center">
<h4>Vegan</h4>
<div class="divide"></div>
<h4>Jerk</h4>
<div class="divide"></div>
<h4>Pasta</h4>
<div class="divide"></div>
<h4>Seafood</h4>
<div class="divide"></div>
</div>
I found the below which doesn’t strip the code but I have to save the HTML somewhere because the editor is blank when I go back to edit the content.
https://linklay.com/stop-wordpress-automatically-removing-html-markups/
// START Stop removing div tags from WordPress – Linklay
function ikreativ_tinymce_fix( $init )
{
// html elements being stripped
$init[‘extended_valid_elements’] = ‘div[*]’;
// pass back to wordpress
return $init;
}
add_filter(‘tiny_mce_before_init’, ‘ikreativ_tiny_mce_fix’);
// END Stop removing div tags from WordPress – Linklay