Widget without DIV wrapper

Whenever I add a text widget it adds a div around the content I add. E.g.

div class="textwidget"
   my content
/div

which messes up the formatting of some of my content.

Is there a way to NOT have the surrounding div? i.e. a widget that just outputs without any surrounding divs?

Topic widget-text widgets Wordpress

Category Web


Check out the register_sidebar() function in the codex:

  • before_widget & after_widget - are your wrapper.
  • before_title & after_title - are your wrapper around the widget title.

They are optional parameters that can be omitted but as @Tom J Nowell noted, you'll encounter many headaches without proper sidebar structure.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.