Skip to:
Content
Pages
Categories
Search
Top
Bottom

Social Media Link Icons in profiles

  • @yoshimitsu1234

    Participant

    Is there any way to add options of social media like facebook twitter google+ icons on profiles of users clicking on which will take us to their social media profile?

Viewing 2 replies - 1 through 2 (of 2 total)
  • @dromy

    Participant

    I agree, can you add option to create a field with a custom link not relating to the search?
    like on the wp profile but on the bp edit profile fields selection.

    @danbp

    Participant

    @yoshimitsu1234 @dromy,

    1) create your social fields on xprofile
    2) give them a name like Twitter or Facebook
    3) tell the user to enter their social username
    4) install font-awesome or similar to get nice social icons

    This function works as of BP 1.7 and was tested on BP 2.0.1. Add it to bp-custom.php or your (child) theme’s functions.php

    Icons are showed under @username | active since at the right of the user avatar on the profile header.

    Remove the text Test… if you want to use only font-awesome icons or replace it with an image or text of your choice

    function bpfr_socialize_profile () {	
    
    echo '<br>'; // don't remove !
    
    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>Test Twitter</a>&nbsp;
    
    <?php endif;
    
    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>Test FB</a>		
    
    <?php		
    endif;
    }
    add_filter( 'bp_before_member_header_meta', 'bpfr_socialize_profile' );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Social Media Link Icons in profiles’ is closed to new replies.
Skip to toolbar