Hi there, I’m using the following code to show Xprofile Field Data in The Profile Header.
I want the code excluded from profiles own profile. The only way I know is to exclude the code from being displayed with css .myaccount But it’s not wrapped in a div so I have no class to attack. What is best, adding a div class, or exclude own profile in the code?
Help with both solutions would be much appreciated, thanks!
/** * Buddypress Show Xprofile Field Data in The Profile Header. */ function yzc_add_xprofile_field_data_in_profile_header( $name ) { $field_data = xprofile_get_field_data( 'Alder', bp_displayed_user_id() ); if ( ! empty( $field_data ) ) { echo '<br/><strong>Alder:</strong> ' . $field_data; $field_data = xprofile_get_field_data( 'Fra', bp_displayed_user_id() ); if ( ! empty( $field_data ) ) { echo ' <br/> <strong>Fra:</strong> ' . $field_data; $field_data = xprofile_get_field_data( 'Job', bp_displayed_user_id() ); if ( ! empty( $field_data ) ) { echo '<br/><strong>Job:</strong> ' . $field_data; } } } } add_action( 'bp_before_member_header_meta', 'yzc_add_xprofile_field_data_in_profile_header' );
Hi Carsten,
Thank you for the post.I have replied to your pther post
https://buddydev.com/support/forums/topic/show-xprofile-field-data-in-the-profile-header-exclude-own-profile-2/#post-32490Regards
Brajesh
Viewing 2 posts - 1 through 2 (of 2 total)
The topic ‘ [Resolved] show Xprofile Field Data in The Profile Header, exclude own profile’ is closed to new replies.
This topic is: resolved