Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: profile fields by id


Boone Gorges
Keymaster

@boonebgorges

That will work. The only problem is that it’s not entirely future-proof. If the structure of the $field object changes in future versions of BP, you’ll have to rewrite the code.

If I were you, I would use a profile loop, as described at https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-profile-data-loop-bp_has_profile/. That way you can use the built-in template tags, which won’t break when BP is upgraded.

The xprofile template tags aren’t as fleshed out as I wish they were, but they should work nicely for your purpose. Put the three fields that you want to appear in column 1 in a profile field group, the next three fields in another group, etc. Then it’ll be easy to create the markup using bp_profile_groups() loop.

Skip to toolbar