Making profile field data public?

Hi there,

I’m outputting member profile fields to an author.php file. I’m using the following php code to do this for each field:

<?php echo get_user_field('field_name'); ?>

I need the selected field data to be available to the public but two unexpected things happen using the get_user_field in this way:

  1. When I’m logged in the author.php file displays my profile field data for all users
  2. When I’m logged out the profile field data does not display

Is there anyway to resolve this?

Many thanks,

As this KB article explains, get_user_field is designed to retrieve the current user. So it’s behaving precisely as intended.

You need to use some regular WP function, and then have it mooch through s2Member’s metadata.