I have some custom Gutenberg blocks as a plugin. I want to include them in my theme. This is not working. How can I get it to register the gutengberg blogs from the theme?
]]>As this relates to a commercial plugin, please use their official support channel. We feel they are best equipped to support their products.
https://www.advancedcustomfields.com/support/
Commercial products are not supported in these forums.
]]>I made a plugin that registers custom gutenberg blocks.
I want to include it in my theme so that when the theme is install the blocks also become available without also having to install a separate plugin.
I am aware why this is not the recommended strategy by WordPress as it carries with the risk of theme lockin and making a website break content when the theme is changed.
But that’s not a concern in my use case and I am trying to make an install process more seamless. That’s my priority.
Thanks.
]]>I know the js and css files are all fine because the only thing I’m doing is copying the working plugin folder into my theme folder and then trying to enqueue the scripts from there.
add_action( 'enqueue_block_editor_assets', 'block05editor_scripts' );
function block05editor_scripts() {
wp_enqueue_script(
'block05editor_scripts',
get_stylesheet_directory() . '/Jackalope-Gutenberg/05-media-block/block.build.js',
array( 'wp-blocks', 'wp-i18n', 'wp-editor', 'wp-components' ),
''
);
wp_enqueue_style(
'block05editor_styles',
get_stylesheet_directory() . '/Jackalope-Gutenberg/05-media-block/editor.css',
array(),
''
);
}
//- ADD BLOCK ASSETS FOR FRONTEND
add_action( 'enqueue_block_assets', 'block05frontend_styles' );
function block05frontend_styles() {
wp_enqueue_style(
'block05frontend_styles',
get_stylesheet_directory() . '/Jackalope-Gutenberg/05-media-block/style.css',
array(),
''
);
}
]]>