Skip to content

Instantly share code, notes, and snippets.

@bentasm1
Created February 21, 2015 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bentasm1/bbf5f832555c71585b53 to your computer and use it in GitHub Desktop.
Save bentasm1/bbf5f832555c71585b53 to your computer and use it in GitHub Desktop.
To customize the single member header
/yourtheme/buddypress/members/single/member-header.php
-----
<?php
$wcv_profile_id = bp_displayed_user_id();
$wcv_profile_info = get_userdata( bp_displayed_user_id() );
$wcv_profile_role = implode( $wcv_profile_info->roles );
//$vendor_id = get_the_author_meta( 'user_login' );
if ( $wcv_profile_role == "vendor" ) {
$vendor_name_message = get_the_author_meta( 'user_login' );
$current_user = wp_get_current_user();
echo "<br><br>";
if ( is_user_logged_in() ) {
echo do_shortcode( '[button link="/members/'.$current_user->user_login.'/messages/compose/?r='.$wcv_profile_info->user_login.'"]SEND ME A PRIVATE MESSAGE[/button]' );
} else {
echo do_shortcode( '[button link="/my-account/"]LOGIN TO SEND ME A PRIVATE MESSAGE[/button]' );
};
echo do_shortcode( '[button link="/members/'.$wcv_profile_info->user_login.'"]VIEW MY PROFILE[/button]' );
echo do_shortcode( '[button link="/vendors/'.$wcv_profile_info->user_login.'"]VISIT MY STORE[/button]' );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment