Support

Account

Home Forums Front-end Issues Frontend: Cloned fields not displaying

Solved

Frontend: Cloned fields not displaying

  • Hello, this one has been puzzling me but it’s maybe easy to fix. I have a cloned group on my homepage with some basic fields, the fields are saving but nothing displays on the frontend unless I enable the “Prefix Field Names” option. However, I have the exact same thing on a custom post type and everything works fine.

    I want to keep the same PHP structure (image attached) to reuse this block on multiple pages, so prefixing the field name isn’t really an option. Any idea why? Thanks

    Video explanation: https://www.loom.com/share/2095c0748a364f3192a4165de1bbcc8f

  • what in your code represents the clone field, or the fields that are cloned?

  • Hey John, it’s everything in the if statement. However, the original field was named “banner”, I fix the “problem” by renaming the cloned group to something else and it solved the issue. It is still using “banner” somehow. Hope I am making sense!

  • In order to use “have_rows()” on a cloned field the field must be set to display as a group ranter than inline.

    display inline: use get_field() on each field in the cloned group
    display group: use have_rows() and get_sub_field() for each field in the cloned group

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

You must be logged in to reply to this topic.