Support

Account

Home Forums Gutenberg Block template Reply To: Block template

  • Hi, I’m not sure if this is what you are looking for but on my end it works great:

    add_action( 'init', 'slug_post_type_template' );
    function slug_post_type_template() {
    	$page_type_object = get_post_type_object( 'projects' );
    	$page_type_object->template = array(
    		array( 'acf/header', array() ),
    		array( 'acf/texts', array() ),	
    		array( 'acf/photos', array() ),	
    	);
    }

    You can check the source on this page:
    https://florianbrinkmann.com/en/define-block-templates-5678/