[Resolved] Term custom fields not available for conditional tests
This thread is resolved. Here is a description of the problem and solution.
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 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.