Top
Home
Facebook Profile Photo and Link

IN TEMPLATE

<?php
$user_id = $post->post_author;
$user_info = get_userdata($user_id);
echo '<a style="float:left;margin:10px;margin-top:0px" href="' . $user_info->facelink . '" target="face"><img src="' . $user_info->facephoto . '" /></a>';
?>

IN FUNCTIONS.PHP

<h3>Links for Facebook Profile and Link</h3>
<table class="form-table">
<tr>
<th style="text-align:right"><label for="facephoto">FaceBook Profile Photo</label></th><td>
<input type="text" name="facephoto" id="facephoto" value="<?php echo esc_attr( get_the_author_meta( 'facephoto', $user->ID ) ); ?>" class="regular-text" /><br />
<span class="description">Please link to your Facebook profile photo.</span>
</td>
</tr>
<tr>
<th style="text-align:right"><label for="mooseloose">FaceBook Link</label></th><td>
<input type="text" name="facelink" id="facelink" value="<?php echo esc_attr( get_the_author_meta( 'facelink', $user->ID ) ); ?>" class="regular-text" /><br />
<span class="description">Please paste link to your FaceBook page.</span>
</td>
</tr>
</table>
<?php }
add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
function my_save_extra_profile_fields( $user_id ) {
if ( !current_user_can( 'edit_user', $user_id ) )
return false;

update_usermeta( $user_id, 'facephoto', $_POST['facephoto'] );
update_usermeta( $user_id, 'facelink', $_POST['facelink'] );

}
?>