<?php
// Check if the flexible content field has rows of data:
if (have_rows('sections')):
// Loop through the rows of data:
while (have_rows('sections')) : the_row();
// Load the corresponding template file:
include(locate_template('templates/'.get_row_layout().'.php'));
endwhile;
endif;
?>