Skip Navigation

[Resolved] Display existing user meta image url

This support ticket is created 8 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 - -
15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 - -

Supporter timezone: Asia/Jerusalem (GMT+03:00)

This topic contains 8 replies, has 2 voices.

Last updated by Itamar 8 years ago.

Assisted by: Itamar.

Author
Posts
#389302

Hi,

I'm trying to display an author image (custom user meta field not created/managed by Types) via the following, how would I do that with types_render_usermeta_field?

$profile_image_url = get_the_author_meta( 'profile_image_url', $user->ID );
echo '<div>';
printf( '<img src="%1$s" class="profile-image" alt="%2$s" />', $profile_image_url, $name );
echo '</div>';

,

I tried several variations of types_render_usermeta_field but couldn't get the URL to be outputted.

Cheers,
Thomas

#389510

Itamar
Supporter

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hello, Thomas.

Thank you for contacting the Toolset support forum.

If you would like to display a field for the current Post author, please use 'types_render_usermeta_field' like the following example:

<?php
echo(types_render_usermeta_field( "author_image", array( "alt" => "Author image",
    "width" => "300", "height" => "200", "proportional" => "true" ) ));
?>

Please follow the link to our documentation about Displaying WordPress User Fields:
https://toolset.com/documentation/user-guides/displaying-wordpress-user-fields/

Please let me know if the above solution works for you, I look forward to your reply!

Thanks,
Itamar.

#389633

Unfortunately, that doesn't display anything.

Do the user meta fields need to be added by Types? Is there any other reason a field couldn't be displayed?

Cheers,
Thomas

#389643

I just checked: user meta fields added via Types are displayed just fine, but not already existing custom user meta fields NOT added by Types.

Can't these be controlled by Types as well...?

Cheers,
Thomas

#390728

Itamar
Supporter

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi, Thomas.

I'm sorry for the late response.
I am also experiencing some problems with displaying user meta fields.
I would like to check this with our developers.
I'll get back to you as soon as possible on this matter.

Thank you for your patience.
Itamar.

#390868

Itamar
Supporter

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

user-basic-data-fields.jpg

Hi, Thomas.

Indeed 'types_render_usermeta_field' render only user fields created by Types.

If you want to display WP default user fields with Toolset plugins you use any of the 'User basic data' shortcodes.
You can insert them through the Fields and Views button inline in any post or through Views or Content Templates.
Please see the attached screenshot user-basic-data-fields.jpg

Please let me know if you have further questions regarding the issue mentioned in this thread.

Thanks,
Itamar.

#390959

Itamar
Supporter

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

I'm sorry, Thomas.

In my last reply, I forgot to mention another possibility.
You can convert non-Types fields to work with Types, but anything that is not a "simple" field will probably break.
This is because a plugin might store special fields (arrays and such) in a specific mode that Types cannot control.

In any case to do that go to:
Toolset => Post/User fields => Post/User Fields Control
From there you turn any field not managed by Types to a field that is managed by Types.

Please see this link for explanations:
https://toolset.com/faq/how-do-i-convert-existing-custom-types-and-fields-to-types-control/

Thanks,
Itamar.

#390961

Hi there,

Thanks. I hoped to be able to use the various Types render image format features for an already existing image user meta field. I guess that's not possible then though.

Cheers,
Thomas

#390981

Itamar
Supporter

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Thomas.

Please acknowledge that radios fields, select fields, checkboxes fields, date fields, etc, have specific formats in different plugins.

So anything that is not a string or a number will be probably be broken after bringing those fields under Types Control.

If you can not find the Custom Field’s in Toolset > Post Fields/User Fields > Fields Control, it’s because those fields are not stored as default WordPress Custom fields (post_meta or user_meta), and Types can’t find them most probably because those are stored in a custom table in the DataBase.

I suggest that you will try to add Types rendering for that field only after you have backed up your site or do it from a staging/development site. Not on a live site.

Please let me know if you have further questions regarding the issue mentioned in this thread.

Itamar.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.