Try to avoid linking to specific pages, posts, or forms from your template file. While using Post IDs inside templates would normally work fine, we should make our templates flexible.
Rule of Thumb: Build your templates assuming the database could get wiped out at any time or that the rows in the database could get jumbled.
To get around using Post IDs in template files, you can take an option-based approach. For example, create an Options page and use a Post Object field type to allow the user to set the correct post, page, or form to load in the template.
Note: By default, Gravity Forms are hidden from the Advanced Custom Fields Post Object field types. To combat this, use Gravity Forms ACF Field.
INCORRECT:
gravity_form(1, false, false, false, null, true, 99);
CORRECT:
$chosen_gravity_form = (int) get_field('contact_form', 'options');
gravity_form($chosen_gravity_form, false, false, false, null, true, 99); ?>
INCORRECT:
function hm_get_team_members() {
$team_members = hm_get_child_pages(96);
return $team_members;
}
CORRECT:
function hm_get_team_members() {
$team_members_page = get_field('team_members_page', 'options');
$team_members = hm_get_child_pages( $team_members_page->ID );
return $team_members;
}