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/
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.