Support

Account

Forum Replies Created

  • There is a big reason to use get_post_meta instead of ACF functions :
    Way less queries to the database and less load on the frontend. Best if you disable acf on the frontend(search for it on google) and use only get_post_meta.
    Tested it with Code Profiler and the difference is huge.

  • I searched everywhere and nothing found about how to use get_post_meta for group type fields.
    After I did some tests found the follwing method:

    For example you have a field type group named : group_field_type
    Inside the ‘group_field_type’ you have two text type fields : inside_group_one and inside_group_two

    to get the two text fields inside the group with get_post_meta in php would be:

    
    $inside_group_one = get_post_meta( get_the_ID(), 'group_field_type_inside_group_one', true );
    $inside_group_two = get_post_meta( get_the_ID(), 'group_field_type_inside_group_two', true );
    
    echo $inside_group_one.'<br>';
    echo $inside_group_two.'<br>';
    

    You concatenate the group field name with the field name inside the group.

    Hope it helps.
    Best wishes

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