How to enable wide and full-width images in WordPress Gutenberg themes

in Code Write a comment

In this tutorial, you’ll learn how to add two more alignment options for the image blocks in Gutenberg-ready WordPress themes.

Table of contents hide

Before

After

By default, you can align images left, center and right. But you can extend this functionality with one line of code.


Hi, I'm Renat 👋

 


Simply add the line below to your functions.php file.

add_theme_support( 'align-wide' );

The code above will enable align wide and full-width options.

If you find this post useful, please let me know in the comments below. 
Cheers,
Renat Galyamov

Want to share this with your friends?
👉renatello.com/full-width-images-wordpress

PS: make sure you check other WordPress tutorials, e.g. Split functions.php into multiple files in WordPressload Google Fonts via functions.php in WordPress and download my plugin that improves your WordPress SEO & Performance.

A collection of UI components for
Bootstrap 4/5 and Vue.js

Get now

Write a Comment

Comment