Create a page from different content blocks

I’m not 100% sure I understand. Are you asking how you can determine ahead of time what blocks will be available to a template? That’s what this answer will be for.

Option 1: Patterns

WordPress 6.4 has the ability for you to make patterns from the admin. To do this, open a page or post and add the blocks you want to be available. Then you can select them all and “create pattern” from their toolbar. Name it, and create a category for it. Then you can go into any post or page (custom post types included) and you should be able to find that pattern during block selection to apply to the page. Given instructions, anyone doing content entry can do this.

Option 2: Define the template starting blocks.

If you’re looking for a more automatic solution, this is it.

Apply this code (in your functions.php most likely). This allows you to choose a post type (here it’s ‘post’) and then you can choose blocks to add. In this one, there’s a pattern (this is just an example to show that you can do this with patterns as well as blocks), followed by a heading, and then a paragraph block.

function register_default_posttype_patterns() {
   // set default page layouts
   $selected_post = get_post_type_object( 'post' );
   $selected_post->template = array(
       array( 'core/pattern', array( // pattern format
           'slug' => 'text-domain/patterns-slug',
       ) ),
       array( 'core/heading' ), // block format
       array( 'core/paragraph' ) // block format
   );
}
add_action( 'init', 'register_default_posttype_patterns', 11 );

For your purposes, you might remove the array with the pattern, and then update it for Block 1, Block 3, Block 5 as you said. Then anytime someone opens up a “Post”, it will start with those three blocks already applied.

I hope this helps!

deneme bonusudeneme bonusu veren sitelerpulibet girişOnwin Güncel Giriştürkçe altyazılı pornocanlı bahis casino