Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to grab xprofile data?


Boone Gorges
Keymaster

@boonebgorges

If you want to get information out of the custom xprofile fields, you’ll need to use some of the functions in the profile-loop. I don’t think there are any core BP functions that allow you to pull a specific profile field by name or ID, so you’ll have to create a profile loop (<?php if ( bp_has_profile() ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>), then a profile field loop (<?php if( bp_profile_group_has_fields() : while ( bp_profile_fields() ) : bp_the_profile_field(); ?>) and then loop through the items, picking out the ones you want by field name. Use the code in profile-loop.php as a template for what you want to insert into members-loop.

Skip to toolbar