I am trying to target a widget with a specific class, and place something directly after the opening tag or before the widget title.
This:
<widget>
<h3>Title</h3>
<p>Some content goes here...</p>
</widget>
Becomes:
<widget>
<!-- Custom content or element goes here -->
<h3>Title</h3>
<p>Some content goes here...</p>
</widget>
I can’t quite hook into it, I do not want to use css, this needs to be added with widget logic in order to be user-friendly.
You can use the
dynamic_sidebar_params
filter:where the widget names are for example: Text, Categories, Calendar, … .
You can then modify it to your needs, for example the
'sidebar-1'
,'Text'
and'text-8'
parts.