Hi,
I can see user photos everywhere where I want - posts and comments. However, I'd like to also see them in the users.php page under the administrative settings.
From what I've read - I don't have an authors page in my theme (based on Kubric). The only place where I managed to change things was in my:
wp-admin\includes\template.php
where I had:
$avatar = get_avatar( $user_object->ID, 32 );
and I changed that to:
$avatar = userphoto_thumbnail($user_object);
That did show me the photos - but they don't show up in the table properly - only on top of it. I can't figure it out.
Here's a snippet of my template.php (in the admin it shows under users.php):
$role_name = isset($wp_roles->role_names[$role]) ? translate_user_role($wp_roles->role_names[$role] ) : __('None');
$r = "<tr id='user-$user_object->ID'$style>";
$columns = get_column_headers('users');
$hidden = get_hidden_columns('users');
//$avatar = get_avatar( $user_object->ID, 32 );
$avatar = userphoto_thumbnail($user_object);
foreach ( $columns as $column_name => $column_display_name ) {
$class = "class=\"$column_name column-$column_name\"";
$style = '';
if ( in_array($column_name, $hidden) )
$style = ' style="display:none;"';
$attributes = "$class$style";
switch ($column_name) {
case 'cb':
$r .= "<th scope='row' class='check-column'>$checkbox</th>";
break;
case 'username':
$r .= "<td $attributes>$avatar $edit</td>";
break;
case 'name':
$r .= "<td $attributes>$user_object->first_name $user_object->last_name</td>";
break;
case 'email':
$r .= "<td $attributes><a href='mailto:$email' title='" . sprintf( __('e-mail: %s' ), $email ) . "'>$email</a></td>";
break;
case 'role':
$r .= "<td $attributes>$role_name</td>";
break;
case 'posts':
$attributes = 'class="posts column-posts num"' . $style;
$r .= "<td $attributes>";
if ( $numposts > 0 ) {
$r .= "<a href='edit.php?author=$user_object->ID' title='" . __( 'View posts by this author' ) . "' class='edit'>";
$r .= $numposts;
$r .= '</a>';
} else {
$r .= 0;
}
$r .= "</td>";
break;
default:
$r .= "<td $attributes>";
$r .= apply_filters('manage_users_custom_column', '', $column_name, $user_object->ID);
$r .= "</td>";
}
}
$r .= '</tr>';
return $r;
}
Thanks.