Hi !
I tried to register a block with acf as followed:
add_action('acf/init', 'bwb_content_gallery');
function bwb_content_gallery() {
// Check function exists.
if( function_exists('acf_register_block_type') ) {
// register a testimonial block.
acf_register_block_type(array(
'name' => 'bwb_gallery',
'title' => __('Galerie Lexuberance'),
'description' => __(''),
'render_callback' => 'acf_render_callback',
'category' => 'formating',
'icon' => 'schedule',
'keywords' => array( 'gallery', 'lexuberance' ),
'mode' => 'edit'
));
}
}
To have a rendering I used ‘render_template’ as first but nothing appears in front-end.
To avoid any path issues with my template I decided to use ‘render_callback’ then.
function acf_render_callback( $block, $content = "", $is_preview = false, $post_id = 0 ) {
?>
<p>RENDERING</p>
<?php
}
“RENDERING” is showing in the editor but nothing in front-end.
Am I missing something ? How to render my block in front-end ?
Hello,
Were you able to resolve this? I have the same issue and I have searched everywhere for a solution but so far no luck.
Thanks