[Resuelto] Term custom fields not available for conditional tests
Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.
Problem:
How to display content conditionally on taxonomy term archive based on term custom field
Solution:
You can use [wpv-conditional] to check the term custom field value on term archive page.
For example:
[wpv-conditional if="( '[types termmeta='module-partner-logo' output='raw' term_id='[wpv-taxonomy-archive info='id']'][/types]' ne '' )"]
Your code goes here
[/wpv-conditional]
This support ticket is created hace 6 años, 2 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.
This is an archive view displaying a taxonomy term. However in the loop editor, I dont have any access to the custom fields I have created for this taxonomy when using conditional tests.
I want to hide the black 'Sponsored by' section of there is no logo (As there is not in the above link). the logo is an image custom fields assigned to this taxonomy.
Hello. Thank you for contacting the Toolset support.
Well - can I have access details so I can check your archive code and try to fix the issue.
*** 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 would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
Well - you can use following conditional shortcode to check if your currently displayed taxonomy archive term has custom field image logo uploaded or not.
[wpv-conditional if="( '[types termmeta='module-partner-logo' output='raw' term_id='[wpv-taxonomy-archive info='id']'][/types]' ne '' )"]
Your code goes here
[/wpv-conditional]
Just wrap the code which you don't want to display when module-partner-logo is not exists.