Wouldn’t it be nice if some blocks would appear in the editor when adding a new post, page or other post type?
For example, always start the page with a slideshow / cover block or Heading.
Is there a way to “auto add” blocks inside a new post?
Got it!
//add default blocks to the content
function indewalvis_post_block_template() {
$post_type_object = get_post_type_object( 'page' );
$post_type_object->template = array(
array( 'acf/slideshow' ),
array( 'core/heading', array( 'level' => 1 ) ),
array( 'core/paragraph' ),
);
}
add_action( 'init', 'indewalvis_post_block_template' );