Forum Replies Created
-
Well I thought it was a BuddyPress issue, which is why I came here. But if you’re all saying that the code I have should be working, then I will definitely contact theme support next.
I’m using Klein, which I bought on ThemeForest: http://themeforest.net/item/klein-a-nittygritty-community-theme/5418518
Certainly possible that there’s some other strange stuff in there! I’ve spent a lot of time undoing some of the weird stuff I’ve come across.
Thanks for your feedback, @danbp.
When I copied everything into pastebin yesterday, I had the code commented out because it wasn’t working and I didn’t want it showing incorrectly on the page.
Later, I deleted that whole commented code section and replaced it with the last code @shanebp shared.
Here’s a new pastebin of the current code: http://pastebin.com/bynhRb2g
And here’s a screenshot of what that’s creating on my page right now: http://screencast.com/t/AcTotzQ2I haven’t done anything else in this file, so the count code came from the theme developer, I guess. (Maybe you can tell from the screenshot what he was trying to accomplish with that code?)
Still no go. 🙁
Oh, I just realized that I shared the code in the members-loop.php file, but perhaps you meant the whole /members page? How would I go about sharing that?
And, FYI, this is a copy of the members-loop.php that I moved to my child theme. My theme is Klein from ThemeForest.
Ah, actually in my most recent attempts I had started putting it right after that as a separate <?php section… But I just tried moving it within the code that actually has that comment (and removed the <?php stuff I added above), and it still doesn’t work.
Just to be sure we’re on the same page, I want it to show nothing if that profile field is blank, and otherwise show what’s been provided in that profile field… And right now, it’s showing, for example, “Los Angeles, CA” for the person who entered that location as well as the people after her in the list who didn’t enter a location.
Thanks for your response, @shanebp.
That code still has the fields repeating, but perhaps I entered it wrong? Since you didn’t include the php tags I’m not sure where they go; I did it this way:
<?php $data = bp_member_profile_data( 'field=Current Location' ); ?> <?php if( $data != false ) ?> <?php echo $data; ?>
I’m having the same problem!
I have just one field I want to show in the Members Directory (members-loop.php), Current Location, and I’ve tried a few different code variations I found here in the forums with no luck.
I thought this one would do the trick, but no dice. With this code, if a member hasn’t filled out the Current Location field, it still shows the value of the last person in the list who did have it filled in.
<?php if ( $data = bp_member_profile_data( 'field=Current Location' ) ) : ?> <?php echo $data ?> <?php endif ?>
Anyone have any suggestions for me and @ariane1001?