Navigation überspringen

[Gelöst] Unable to get user picture based on user ID

This support ticket is created vor 3 Jahre, 7 Monaten. 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 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 4 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Minesh vor 3 Jahre, 7 Monaten.

Assistiert von: Minesh.

Author
Artikel
#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.

versteckter Link

Error on trying the full shortcode - versteckter Link

What am I missing?

#2232847

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: 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
Unterstützer

Sprachen: Englisch (English )

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

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 - versteckter Link

Elementor template - versteckter Link

View - versteckter Link

preview this template for - group A

Shown here - versteckter Link

The image in the column from types code shows the wrong image - versteckter Link

Expert coach ID is shown easily from the shortcode - versteckter Link

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

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

#2238029

Minesh
Unterstützer

Sprachen: Englisch (English )

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

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:
=> versteckter 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:
=> versteckter 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 versteckter Link