Support

Account

Home Forums Front-end Issues Display fields from certain fields group

Solving

Display fields from certain fields group

    • m86

    • October 8, 2019 at 12:07 am

    Hello,

    I’m trying to display the values of fields form a certain groupid, but the documentation does not include that option as far as I know.

    This is what I tried:

    <?php

    $group_ID = 19415;
    $fields = get_fields($groupID);
    $fields = get_field_objects();

    ?>

    <?php if( $fields ): ?>

    <?php foreach( $fields as $field ): ?>

    <?php if( $field[‘value’] ): ?>
    <div class=”listing_detail col-md-6″><?php echo $field[‘label’]; ?>: <?php echo $field[‘value’]; ?></div>
    <?php endif; ?>

    <?php endforeach; ?>

    <?php endif; ?>

  • The content of custom fields are associated with a post, user, taxonomy term or an options page. The contents of fields are not saved in a way that connects them to the field group.

    • m86

    • October 11, 2019 at 11:49 pm

    I’m not talking about the content, I only mean the custom fields labels en variable data it uses.

    I found this works: https://dream-encode.com/acf-get-all-fields-in-a-field-group/

    Should be in the documentation stuff like that though.

  • I did not get that from what you asked for.

    I’m trying to display the values of fields form a certain groupid

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

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.