The beauty of the ACF flexible content blocks page builder is simplicity and ease of use for administrators.
As the page builder blocks are built using custom fields that map directly to the page content. there is very little room for error.
From our WordPress Training experience teaching a client to use a simple acf flexible content page builder is the easiest form of training to conduct.
This approach is great for building simple sites without too many pages and without too many blocks.
For Developers
/**
* function to output page builder blocks or only return list of blocks
*/
function acf_display_pb_blocks(){
$blocks = array(
'content_with_image',
'client_logos',
'spacer',
'btns',
'cards',
'safety',
'testimonial-slider',
'projects',
'cta',
'blog_posts',
'protecth',
);
if( have_rows('blocks') ):
while ( have_rows('blocks') ) : the_row();
$layout = get_row_layout();
if( in_array( get_row_layout(), $blocks ) ){
get_template_part( 'template-parts/blocks/block', $layout );
}
endwhile;
endif;
}
//add this function to the page
<?php
acf_display_pb_blocks();