If it can be explicetly defined as the_title
, then this should work for you:
$pages = get_pages(array ('sort_column' => 'menu_order'));
foreach ($pages as $page_data) {
$fields = get_fields($page_data);
if( $fields ) {
echo '<div class="the_title">' .$fields['the_title'] . '</div>';
echo '<div class="container">';
foreach( $fields as $field_name => $value ) {
$field = get_field_object($field_name, false, array('load_value' => false));
if($field_name != 'the_title' ){ /*this field does not have key of 'the_title'*/
echo '<div class=".$field_name.">';
echo $value;
echo '</div>';
}
}
echo '</div>';
}
}
Apologies if there are any erroneous gaps. My phone likes to drop in spaces when I’m writing code for some reasons.
any questions, ask away.