Skip Navigation

[Resuelto] Issue with Conditional Block and Author Profile Image

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

Use custom user field in conditional block.

Solution:

You will need to use "Expert mode" of Toolset conditional block, see my screenshot:

https://toolset.com/forums/topic/issue-with-conditional-block-and-author-profile-image/#post-1877869

Relevant Documentation:

This support ticket is created hace 3 años, 11 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Etiquetado: 

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por Darryl hace 3 años, 11 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#1877443
Edit%20Content%20Template%20‹%20Kamloops%202020-12-15%20at%201.03.29%20PM.me%20—%20WordPress%20-%20Google%20Chrome[1].png

I am trying to use the conditional block to see if the author of the current post has a profile image.

Pic of settings uploaded.

I'm reading the settings (in pic) as, if the author of the current post does not have a profile image, display the stuff in the conditional block.

I have an additional conditional block with the same conditions but with the "not" enabled.

Whether or not the post's author has a profile image, it always thinks they don't.

Bonus additional settings video: enlace oculto

#1877869
Advanced-Editor.JPG

Hello,

I assume we are talking about a custom user image field "Advanced Editor", if it is, you will need to use "Expert mode" of Toolset conditional block, see my screenshot: Advanced-Editor.JPG.

for example:
No image:

  ( ( '[types usermeta="profile-image" output="raw" user_is_author="true"][/types]' eq '' ) ) 

Has image:

  ( ( '[types usermeta="profile-image" output="raw" user_is_author="true"][/types]' ne '' ) ) 

Please replace "profile-image" with your custom user image field slug,

More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/#image
Click link "Usage examples"
user_is_author:
"true" - output field for current Post author

#1878711

That did not seem to work.
What I ended up doing was inserting a template containing:

[wpv-conditional if="( '[wpv-post-author format="profile_picture"]' ne '' )"][wpv-post-author format="profile_picture" profile-picture-size="200"][/wpv-conditional]