Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Dynamically Display HTML depending on User

@cameck

Participant

All right thank you everyone, I finally figured it out.

I was not able to find an S2 Member function that worked for my specific task.

Luckily I had a custom BuddyPress field that also designated the user Level.

I got the field ID of “55” by hovering over the edit portion of the custom profile field.

This is the final working code:

<?php if(is_user_logged_in() && xprofile_get_field_data( 55 ) == 'Employee'){ ?>

<div class="paybox">
<h3>Make Payment with PayPal&reg;</h3>
<?php $uemail = getDisplayedUserEmail(); ?>
<?php echo do_shortcode('[gravityforms id="7" field_values="recip-email=' . $uemail . '"]'); ?>
</div><!-- .paybox -->
<?php } ?>
Skip to toolbar