Add an image field into the profile card in the member directory
Special field types (files, images, etc.) can't be added into the profile card. Settings "Choose field(s) to display in tagline" and "Choose field(s) to display in extra user information section" don't contain special fields. You can use your custom function attached to the filter um_ajax_get_members_data
to add additional data into the variable "user". See the example below.
Replace um_image_upload
in the $key
variable with a meta key of the image field you need then add this code to the functions.php file in the theme directory. Once the field is added you can use it in template files members-list.php and members-grid.php like this:
<# if ( typeof user.um_image_upload !== 'undefined' ) { #> {{{user.um_image_upload.html}}} <# } #>
You can override template files in the theme directory. Read the article Template structure & Overriding templates via a theme for details. We recommend creating a child theme for customization.
Expected result:
Note: We have created this code example to provide guidance and to make it easier for you to implement this code into your website. However, we are not able to provide any support when it comes to customizing the plugin. If you need help implementing this code, please hire a developer.