$blocks = array(
'page_links', //
'our_impact', //
'our_advantage', //
'campaign_callout', //
'simple_text_content', //
'stepped_content', //
'sponsor_list', //
'accordion_group', //
'video_with_stat', //
'text_with_sidebar', //
'text_with_icon', //
'text_with_image', //
'quote_post',
'carousel'
);
// Start Flexible Content
if ( have_rows( 'content_blocks' ) ) :
while ( have_rows('content_blocks' ) ) : the_row();
foreach ( $blocks as $field ) {
$file = str_replace( '_', '-', $field );
if ( get_row_layout() == $field ) {
get_template_part( '/components/content-blocks/' . $file );
}
}
endwhile;
endif;
?>