Home › Forums › Gutenberg › ACF Blocks won't render when using register_block_template() › Reply To: ACF Blocks won't render when using register_block_template()
I’m sorry, but i’ve the same trouble i can’t find a way to solve it : always get a white page
acf_register_block_type(array(
'name' => 'csm',
'title' => __('Centre de soins'),
'description' => __(''),
'render_callback' => 'acf_csm_block',
'supports' => array( 'align' =>false ),
'post_types' => array('post', 'page'),
'mode' => 'edit',
'category' => 'cnesoa',
'icon' => 'plus'
));
function register_block_template() {
//Posts
$post_type_object_post = get_post_type_object( 'post' );
$post_type_object_post->template = array(
array( 'acf/csm' ),
);
}
add_action( 'init', 'register_block_template' );
What i’m doing wrong ?
thank you
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.