This solution is based on a question from a registered member who wanted to use a tutorial containing code for a f.a.q template, in a widget area.
The code in this tutorial enables you to paste HTML into a after entry text widget and display a list of links to hidden content which is displayed when the link is toggled:
The code uses a small amount of jQuery which you can load conditionally on single posts only and also includes a handful of CSS rules for styling.
You can change the icons from + and – to any other dashicons in the CSS simply by changing the number 132 and 460 for each icon as seen in the following CSS declaration.
And float the icons right like this :
Here’s the demo video
Here’s the code for logged in members :