Monday 12 February 2018

Gutenberg & Themes


WordPress is set to receive a brand new editor, some time this year with WordPress 5.0. Along with this new editor are some new features that themes can opt into. This post will cover what those new features are. If you only ever read one thing about Gutenberg and themes, though, know this: there is no "Gutenberg theme", and as a theme builder, there’s nothing you have to do, to be compatible with the new editor.
As with all things, there may be more features you can opt into in the future. But the editor that will ship with WordPress 5.0 will not require you to make any changes.
Wide Images
While you don’t have to do this, you can opt into supporting wide images. Gutenberg specifically supports two new image sizes: wide, and fullwide. Here’s a fullwide image:
You can use these alignments on nearly all blocks. Here’s the wide alignment applied to a gallery:
When a theme supports wide alignments, blocks get access to two new alignments on the toolbar:
The two last buttons are wide and fullwide respectively. The way your WordPress theme opts into these two alignments, is to paste the following snippet into your functions.php :
add_theme_support( ‘gutenberg’, array(
‘wide-images’
Source: https://managewp.org/articles/17087/gutenberg-themes



source https://williechiu40.wordpress.com/2018/02/12/gutenberg-themes/

No comments:

Post a Comment