Support

Account

Home Forums Gutenberg Having Issues with Repeater and Render Template k

Solved

Having Issues with Repeater and Render Template k

  • I am using the ACF Pro Repeater Fields for a project with the location as a Block. The block successfully loaded on the edit page but it is not being rendered to the front end. I will appreciate some help.

    Here is the code I used to test the page Template:

    //Register a Building Projects Block 
    add_action('acf/init', 'my_acf_init_block_types'); function my_acf_init_block_types() {
    
    // Check function exists.
    if( function_exists('acf_register_block_type') ) {
    
         // register a building project block.
        acf_register_block_type(array(
            'name'              => 'building_projects',
            'title'             => __('Building Projects'),
            'description'       => __('A custom block for Building Projects.'),
            'render_template'   => get_template_directory() . '/template-parts/blocks/building-projects/building-projects.php',
            'category'          => 'formatting',
            'icon'              => 'building',
            'keywords'          => array( 'building', 'nodaco' ),
            
        ));
    }
    
    // Load values and assign defaults.
    
    $sub_text = get_sub_field('project_descriptions') ?: 'Detail Project here...';
    
    ?>
    
    echo($sub_text);
  • RESOLVED
    The issues were much more beyond the ACF plugin. So, for anyone who may be having similar issues, I used the define( ‘WP_DEBUG’, true );
    define( ‘WP_DEBUG_LOG’, true ); in the`config.php file which revealed the true the coding issues in the function.php file and then the template. It took me a bit to clean up the codes and the fields were displaying as expected.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.