Hi,
I am trying to understand how to get the default blocks in Gutenberg to match the editor when they are outputted to the front end. This is something that has been somewhat of a mystery for me, so please bear with my limited understanding.
Below I have used the core block called “cover” it looks fine in the block editor.
However when I preview the page the block looks like this, notice the text is below the image (not the same as the block editor)
I noticed Radicle had this Theme supports section so I modified it
/**
* Theme supports
*/
'support' => [
/**
* @link https://developer.wordpress.org/reference/functions/add_theme_support/#html5
*/
'html5' => [
'caption',
'comment-form',
'comment-list',
'gallery',
'search-form',
'script',
'style',
],
/**
* @link https://wordpress.org/gutenberg/handbook/designers-developers/developers/themes/theme-support/#wide-alignment
*/
'align-wide',
/**
* @link https://developer.wordpress.org/reference/functions/add_theme_support/#title-tag
*/
'title-tag',
/**
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
'post-thumbnails',
/**
* @link https://wordpress.org/gutenberg/handbook/designers-developers/developers/themes/theme-support/#wide-alignment
*/
'responsive-embeds',
/**
* @link https://developer.wordpress.org/themes/advanced-topics/customizer-api/#theme-support-in-sidebars
*/
'customize-selective-refresh-widgets',
'wp-block-styles',
'editor-styles',
/**
* @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/#disabling-the-default-block-patterns
*/
'core-block-patterns',
/**
* @link https://wptavern.com/gutenberg-10-5-embeds-pdfs-adds-verse-block-color-options-and-introduces-new-patterns
*/
],
/**
* Remove theme supports
*/
'remove' => [
],
To add wp-block-styles
, editor-styles
& core-block-patterns
Ran yarn build
And still no style change on the front end
I noticed there were classes like
wp-block-cover
But no css was attached to them on the front end.
Do I have to import styles to the front end that are missing, what may the issue be?