Hello,
I am trying to display on profile page screen , but only if displayed member type is equal to member type.
Something like this which does not work…<?php $member_type = bp_get_member_type( bp_displayed_user_id() ); if ($member_type == 'teacher' ) : {?> <div class="teacher-only-class"> I am a teacher </div> <?php } endif; ?> <?php if ($member_type == 'student' ) : {?> <div class="student-only-class"> I am a student </div> <?php } endif; ?>
edit- i have multiple member types and need to check array for each div class
Any help would be appreciated
Thanks- This topic was modified 5 years, 9 months ago by Chad.
Hi Chad,
Thank you for the question.1. A better option will be to usebp_has_member_type () like this
if ( bp_has_member_type( bp_displayed_user_id(), 'teacher' ) ) { ?> <div class="teacher-only-class"> I am a teacher </div> <?php }
Regards
Brajesh
Viewing 4 posts - 1 through 4 (of 4 total)
The topic ‘ [Resolved] Member type pro – profile – if displayed user is member type – echo’ is closed to new replies.
This topic is: resolved