Site logo

Archived topic

div class "textwidget" missing after update

2 replies · Started by blackbird on July 22, 2021

Viewing posts 1–3 of 3

Hi yesterday I updated WP and GP and GPBlocks. After that I got a red alert about all my widgets in the widgets admin. Something like "The block "text" is probably wrong and may not function correctly" and so on for every widget. My guess is this is a way by WP to tell me I need to update all widgets to the new block function?? Nothing to be scared about?

But more important is this:
I picked one "old widget" and clicked convert to block. Another widget I deleted and wrote from scratch as a text block.

My problem is, after changing to the new widget block type the text widgets no longer wrapped in the old CSS class:
<div class="textwidget">

Insetad they are just normal "P", and have picked up the styling from content P, so there is now a new bottom margin added to the widget.

You can see it in the top bar widget.

Is this expected and as it should work from now on? (So I will have to re-work my widgets in a new way. I can do that...)
Or a bug?

Hi there,

yes the new Block Widgets do throw a lot of things up in the air! And WP are 'pushing' users to convert to the new blocks, which does mean rebuilding them.

Some advice here on using the Group Block for widget containers:

https://docs.generatepress.com/article/grouping-widgets/

And you can give the Group Block or the Text Block an Advanced > Additional CSS Class of textwidget if required. You will want to do this from the Dashboard > Appearance > Widgets though - not in the Customizer.

Or if you want you can decide to leave it for another day and disable block widgets:

https://docs.generatepress.com/article/disable-the-block-editor-in-widgets/

Thank you, clear answer as always!
Ok, then I know I do not have to revert my site back. This is the future, like it or not ;-)

Very important info about the Group Block!! That will be usefull.
So widgets are now no different from other content... interesting and I guess a CSS class will be handy many times.

I did see there also a plugin for disable new widgets, but I will dive right in to this since I am already in changing-everything-mode.

This archived topic is closed to new replies.