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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?
— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.