I want it to be fairly easy for the post author to setup an accordion, based on header tags. So for example this:
<h3>Headline 1</h3>
<p>Content.. lorem ipsum</p>
<h3>Headline 2</h3>
<p>Content.. lorem ipsum</p>
<h3>Headline 3</h3>
<p>Content.. lorem ipsum</p>
would be converted to this (and so, accordion is activated)
<div class="accordion">
<h3>Headline 1</h3>
<div><p>Content.. lorem ipsum</p></div>
<h3>Headline 2</h3>
<div><p>Content.. lorem ipsum</p></div>
<h3>Headline 3</h3>
<div><p>Content.. lorem ipsum</p></div>
</div>
I’ve been using a setup with shortcodes â but this gets too complicated for the post author â so a more streamlined solution would be grand. Any ideas how I would go about doing this?
You can use shortcode function to do this.
In editor you wrap your content: