Support

Account

Home Forums General Issues How to get the Field Group ID from a page? Reply To: How to get the Field Group ID from a page?

  • I’m looking for this exact same thing. Currently I’m doing something like this, `<?php
    //or insert the ID of your fields Group.
    $groupID=’2480′;
    $custom_field_keys = get_post_custom_keys($groupID);
    $items = count($custom_field_keys);
    foreach ( $custom_field_keys as $key => $fieldkey )
    {
    if (stristr($fieldkey,’field_’))
    {
    //echo $key . ” => ” . $fieldkey . “<br />”;
    //echo $field[‘label’] . ‘: ‘ . $field[‘value’];
    //echo $fieldkey . “<br />”;
    $field = get_field_object($fieldkey, $groupID);

    echo ‘<span class=”h4″>’ . $field[‘label’] . ‘</span><br /><span class=”sans”>’ . $field[‘value’]. ‘</span></p>’;

    }
    }
    ?>`

    But would love to know how to get it from the post/page id.