With Gutenberg getting closer and closer to being ready for merge into core WP, I thought it’d be time to look at two of my favorite features being introduced for users and theme developers. That’s the .alignwide and .alignfull classes. These are two classes that I’ve wished we had for ages. I’ve seen some theme authors implement them in the past, but there was no standard naming scheme for them. Therefore, they couldn’t be shared across themes. Regardless of the direction of the Gutenberg plugin, these two classes are more than welcome. In this tutorial, I’m going to cover adding support for and styling these new classes. I’m already making liberal use of the classes on this site without actually having Gutenberg installed. This is useful with or without the plugin. While the primary use case in Gutenberg covers images, I’m using the feature for other things too, such as full-width testimonials on my product pages and elsewhere. Adding Gutenberg support Adding support for wide and full images is pretty simple. You need to drop the following code into your theme setup function, which should be hooked to after_setup_theme: add_theme_support(
Share This

We are using cookies on our website

Please confirm, if you accept our tracking cookies. You can also decline the tracking, so you can continue to visit our website without any data sent to third party services.