Skip Navigation

[Resolved] Unable to get user picture based on user ID

This support ticket is created 4 years, 8 months 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 4 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#2232779

I am trying to using the shortcode as per the documentation to get image based on user ID but does not seem to work.

What could I be missing?

1
[types usermeta='profile-picture' align='center' width='100px' height='100px' output='img' user_id='[wpv-post-field name=wpcf-expert-coach-user-id]']
The image exists and the expert coach user id also exists.

I followed the steps in this thread - https://toolset.com/forums/topic/unable-to-get-user-picture-based-on-user-id/?bbp_reply_to=2222227&_wpnonce=68ff6c3326#new-post

The shortcode [wpv-post-field name=wpcf-expert-coach-user-id] shows id on its own and when I enter the ID in types field that works too.

I also tried to register the wpv-post-field name on 3rd party shortcodes but it does not allow spaces so I registered wpv-post-field but that did not solve the issue.

hidden link

Error on trying the full shortcode - hidden link

What am I missing?

#2232847

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share problem URL and admin access details so I can check whats going wrong with your setup.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2236009

Minesh
Supporter

I see you are using Elementor - could you please tell me where exactly with what elementor template you are trying to display the author profile image?

#2236527

Post to view - hidden link

Elementor template - hidden link

View - hidden link

preview this template for - group A

Shown here - hidden link

The image in the column from types code shows the wrong image - hidden link

Expert coach ID is shown easily from the shortcode - hidden link

The right image is shown when I use the ID in the shortcode instead of generating ID from nested shortcode - hidden link

I have added wpv-post-field as a 3rd party shortcode but it does not change anything - hidden link

#2238029

Minesh
Supporter

It seems Elementor does not able to parse the nested shortcodes so I've created the following content template and added the shortcode within it that displays the image:
=> hidden link

[types usermeta='profile-picture' align='center' width='75px' height='75px' output='img' user_id='[wpv-post-field name="wpcf-expert-coach-user-id"]'][/types]

Then - within the elementor shortcode's module I've added the content template shortcode:
=> hidden link

[wpv-post-body view_template="ct-profile-page-image"]

I can see it shows the correct image on backend now. Please check the following screenshot hidden link