Shouldn’t need to have to perform a while loop in a members loop, it should be much easier than that
if(bp_get_member_profile_data( ‘field=Company Name’ ) == ’special’)
Something along those lines. Over the last day or two there have been a few posts on the subject of profiles, and all the info one could need is to be read in these so have a scroll back over the last 3 or so pages of posts – in fact one post was about not having to create while loops, an old post but resurfaced.
hi hnla, the while loop is already part of the file, it’s within the groups dir not the members dir, just incase this makes a difference?
I’m also a bit puzzled by your code, all I wish to do is display the value of my field, your code looks like it says if it equals? Perhaps I’m wrong?
Yep sorry misunderstood or didn’t read carefully enough the mention of ‘group’
If you haven’t got there yet this works for me on the members view in groups/single/members.php:
Hi hnla, thanks for the reply, after a slight bit of tweaking, I found this worked:
Cool, yes it was the ‘group’ in bp_get_group_member_id() that foxed me for a while.
considering both snippets work to the same effect, do you consider one over the other to be preferable?
Hi hnla, I personally like the way I’ve written it, I find it far easier to maintain the code and helps me be consistent throughout
Fair point, consistency is good
Great tutorial! Got it working!
Anyone know how to remove remove the automatic links in these fields?
It’s been discussed often there is a means, can’t recall if a plugin, no links to hand I’m afraid but have a hunt through the archives for posts on the subject.
I think you are referring to the Custom Profile Filters for BuddyPress plugin (https://wordpress.org/extend/plugins/custom-profile-filters-for-buddypress/installation/)
I had this installed already and works perfectly in the members-loop. But it doesnt apply it to the bp_group_the_member loop
The automatic links still show up…
So this is where I’m getting stuck…