• Resolved visbyweb

    (@visbyweb)


    I’m trying to make a gutenberg block template (the same predefined blocks on every new post I create) for a CPT called Galleri made in Pods. Described here: https://developer.www.ads-software.com/block-editor/developers/block-api/block-templates/#api

    function myplugin_register_template() {
    $post_type_object = get_post_type_object( ‘galleri’ );
    $post_type_object->template = array(
    array( ‘core/paragraph’ ),
    array( ‘core/gallery’ ),
    );
    }
    add_action( ‘init’, ‘myplugin_register_template’ );

    It works fine on regular posts if I replace “galleri” in the code with “post”, but not on the Pod created post type. REST API is activated in Pods so Gutenberg is there as it should but not my block template.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Gutenberg Block Template’ is closed to new replies.