Skip to content

Commit

Permalink
Fixed default profile image, and profile images on Team page.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbohacek committed Apr 28, 2018
1 parent 3b1bd65 commit 0b26792
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion includes/extra-user-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function extra_user_profile_fields( $user ) { ?>
$profile_img_url = esc_attr( get_the_author_meta( 'profile-img-url', $user->ID ) );

if ( empty( $profile_img_url )){
$profile_img_url = get_avatar_url($author_id);
$profile_img_url = get_avatar_url($user->ID);
}

?>
Expand Down
12 changes: 7 additions & 5 deletions template-team-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,19 @@
$full_name = "{$first_name} {$last_name}";
}

$profile_img_url = esc_attr( get_the_author_meta( 'profile-img-url', $author_id ) );

if ( empty( $profile_img_url )){
$profile_img_url = get_avatar_url($author_id);
}

$website_url = esc_attr( get_the_author_meta( 'user_url', $author_id ) );
$twitter_handle = str_replace('@', '', esc_attr( get_the_author_meta( 'twitter-handle', $author_id ) ) );


?>

<div class="col-xs-6 col-s-2 m-2 text-center">
<a href="<?php echo get_author_posts_url($author_id, $username ); ?>">
<img class="lazy-load rounded" src="<?php echo get_avatar_url($author_id); ?>" data-src="<?php echo get_avatar_url($author_id); ?>" alt="<?php echo $full_name; ?>" title="<?php echo $full_name; ?>, click to view profile">
<img class="lazy-load rounded" src="<?php echo $profile_img_url; ?>" data-src="<?php echo $profile_img_url; ?>" alt="<?php echo $full_name; ?>" title="<?php echo $full_name; ?>, click to view profile">
</a>

</div>
<?php }
} ?>
Expand Down

0 comments on commit 0b26792

Please sign in to comment.