Hello everyone,
I have a question that I am sure some of you will find easy to answer.
I am using s2Member with BuddyPress and Geo My WP. In order to be listed on the site, a member has to pay a fee (open registration is off).
When a non-logged in user searches for members it returns a list where each member’s avatar and name contain links to their BP profile.
What I wish to achieve in the search results is this:
-
For members who are level 1: List in search results but member avatar and name contain no links.
-
For members who are level 2 or above: List in search results and member avatar and name contain links.
I have tried the following code in the the search results members loop as a simple test:
`<?php $levelchk = get_user_field(‘s2member_access_level’);
if($levelchk == 1):?>
<?php bp_member_name(); ?>
The problem with “$levelchk = get_user_field('s2member_access_level');
” is that it returns the level of the user who is currently logged in rather than the user in the search results.
Is there an s2Member function that can check every user’s level in a member’s loop?
Many thanks in advance.