Support

Account

Home Forums General Issues get_field / get_sub_field conditional? Reply To: get_field / get_sub_field conditional?

  • @nyrngrs24 I have done this with cloned fields, what I do is that I encapsulate the cloned field in group fields. Basically I create a group field and then I add one sub field which is the clone. This means that the fields are always sub fields.

    However, my purpose for doing this was so that I could add the same clone multiple times and the group field is named differently each time so it does require different have_rows() loops.

    I get around this by getting the entire group in my template and then calling a function with the array value returned.

    
    $args = get_field('group-field-name');
    my_function($args);