How to add class to and childs of sidebar widget – WordPress

If you are dealing with just one site and not creating a theme maybe the easiest solution is to do it “manually”. It is not the most “professional” way to do it, but it works.

Take a text widget or the new html widget, paste your code, for example:

<ul class="list-group">
  <li class="list-group-item">Cras justo odio</li>
  <li class="list-group-item">Dapibus ac facilisis in</li>
  <li class="list-group-item">Morbi leo risus</li>
  <li class="list-group-item">Porta ac consectetur ac</li>
  <li class="list-group-item">Vestibulum at eros</li>
</ul>

and make the changes (to the links) manually.