Can I use WP blocks in a template?

2 methods

  1. do_blocks, takes block content as a string, parses them, renders each block, then returns the final rendered content. This is the same content in post_content, aka the HTML comment and the HTML tags inside it e.g. something similar to this: echo do_blocks( '<!-- wp:paragraph --><p>Hello world.</p><!-- /wp:paragraph -->');
  2. Use a block template part in a block theme. This way the entire template is blocks