Hi Pat,
Glad we're making progress.
To fetch the image URL from the user's post, you'll need to include some additional steps:
1. You'll create a new post view and set it to show the "membre" post type.
2. Uncheck the option "Don't include current page in query result" and set the number of posts limit to 1.
3. Also include a post auhor filter, so that only the post from the specific author is shown, whose ID is passed through the view's shortcode.
Example Screenshot: versteckter Link
4. While adding the content in the view's "Loop Editor", select "unformatted" option in the wizard and make sure no extra spaces or line breaks exists, in the "Search and Pagination", "Loop Editor" and the "Output Editor" section.
Example Screenshot: versteckter Link
5. Since you'll only need the URL of the image from the custom field from this view, in the loop item's content template, you'll only include it's shortcode:
( ref: https://toolset.com/documentation/customizing-sites-using-php/functions/#image )
[types field=photo' width='[wpv-attribute name="size"]' height='[wpv-attribute name="size"]' url='true'][/types]
Note: Replace "photo" with the actual slug of your image field.
6. Just below this loop item's content template, you'll also see a "Disable the wrapping DIV around the View" checkbox, which also needs to be checked.
All these steps will ensure that no extra content or spaces other than the image's URL is included in this view's output.
7. The last step would be to replace line in the code snippet from the last message, so that instead of getting the image from the user's field, it calls the view's output.
Old line:
$custom_user_image = types_render_usermeta( "user-photo", array( "width" => $size, "height" => $size, "resize" => "crop", "url" => "true", "user_id" => $user->data->ID ) );
New line:
$custom_user_image = trim(do_shortcode('[wpv-view name="slug-of-the-view" author="'.$user->data->ID.'" size="'.$size.'"]'));
Please replace "slug-of-the-view" with the actual slug of your view and note how author and the size attribute is passed to the view's shortcode.
https://toolset.com/documentation/user-guides/passing-arguments-to-views/
regards,
Waqar