Home › Forums › Front-end Issues › ACF has disappeared from frontend? › Reply To: ACF has disappeared from frontend?
This is how I’ve registered the block types in my function file:
add_action(‘acf/init’, ‘my_acf_init_block_types’);
function my_acf_init_block_types()
{
if (function_exists(‘acf_register_block_type’)) {
acf_register_block_type(array(
‘name’ => ‘Video header’,
‘title’ => __(‘Video header’),
‘description’ => __(‘Video header’),
‘render_template’ => ‘template-parts\blocks\video-header.php’,
‘category’ => ‘formatting’,
‘icon’ => ‘admin-comments’,
));
acf_register_block_type(array(
‘name’ => ‘Text with button’,
‘title’ => __(‘Text with button’),
‘description’ => __(‘Text with button’),
‘render_template’ => ‘template-parts\blocks\text-with-button.php’,
‘category’ => ‘formatting’,
‘icon’ => ‘button’,
));
acf_register_block_type(array(
‘name’ => ‘header Image’,
‘title’ => __(‘header Image’),
‘description’ => __(‘header Image’),
‘render_template’ => ‘template-parts\blocks\header-images.php’,
‘category’ => ‘formatting’,
‘icon’ => ‘dashicons-format-image’,
));
acf_register_block_type(array(
‘name’ => ‘header Main Image’,
‘title’ => __(‘header Main Image’),
‘description’ => __(‘header Main Image’),
‘render_template’ => ‘template-parts\blocks\header-main-img.php’,
‘category’ => ‘formatting’,
‘icon’ => ‘dashicons-format-image’,
));
}
}
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.