Home › Forums › Backend Issues (wp-admin) › New block.json method yields "no block types exist" › Reply To: New block.json method yields "no block types exist"
Good afternoon mates. I contacted support and they gave me a solution that worked for me.
I share it with you. Luck
——————————————————————————
The register_block_type() expects a filesystem path(as illustrated at https://drive.google.com/file/d/1j_IaTnRnEJLFraiUKsYrdi5yEhWSkzy8/view?usp=sharing).
That said, please try using the __DIR__ . ‘/path-to-the-block-file.json ensuring the complete path to .json file is added. For example:
register_block_type( __DIR__ . ‘/blocks/testimonial/block.json’ );
In other words, you can try replacing get_template_directory_uri() with __DIR__ or get_template_directory() in block registration code.
Also, confirm if the path returned resolves to your /block.json file.
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.