Saltar navegación

[Resuelto] 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 -

Zona horaria del colaborador: Asia/Kolkata (GMT+05:30)

Este tema contiene 4 respuestas, tiene 2 mensajes.

Última actualización por Minesh 4 years, 8 months ago.

Asistido por: Minesh.

Autor
Mensajes
#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.

enlace oculto

Error on trying the full shortcode - enlace oculto

What am I missing?

#2232847

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: 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
Colaborador

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 - enlace oculto

Elementor template - enlace oculto

View - enlace oculto

preview this template for - group A

Shown here - enlace oculto

The image in the column from types code shows the wrong image - enlace oculto

Expert coach ID is shown easily from the shortcode - enlace oculto

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

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

#2238029

Minesh
Colaborador

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:
=> enlace oculto

[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:
=> enlace oculto

[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 enlace oculto