Skip to content

Instantly share code, notes, and snippets.

@danbp
Created May 27, 2013 13:46
Show Gist options
  • Save danbp/5657144 to your computer and use it in GitHub Desktop.
Save danbp/5657144 to your computer and use it in GitHub Desktop.
BuddyPress 1.7.X Add some social icons on a profile header, at the right of the avatar below the activity meta Pictures are send by CSS with the <i> tag Goes into theme's functions.php file. Tested on BP 1.7.2 and bp-default theme.
// add some social icons on a profile header
function bpfr_socialize_profile () {
echo '<br>';
//check if the field contain a value. If it has one show it.
if ( $data = bp_get_profile_field_data( 'field=Twitter ' ) ) :
?>
<a href="http://twitter.com/<?php echo xprofile_get_field_data( 'Twitter', bp_displayed_user_id() );?>/" target="_blank" title="Twitter"><i class="icon-twitter"></i></a>&nbsp;
<?php endif; // end of the field value check
if ( $data = bp_get_profile_field_data( 'field=Facebook ' ) ) :
?>
<a href="http://facebook.com/<?php echo xprofile_get_field_data( 'Facebook', bp_displayed_user_id() );?>/" target="_blank" title="Facebook"><i class="icon-facebook"></i></a>
<?php
endif;
}
add_filter( 'bp_before_member_header_meta', 'bpfr_socialize_profile' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment