I had create a term fields: taxonomy-introduction2 , Field type: WYSIWYG.
I can display term fields in the taxonomy Archive using:
[types termmeta='taxonomy-introduction2'][/types]
And I want to add a conditional checking: if is there any content in the term fields, display it in Taxonomy Archive
with following code:
[wpv-conditional if="( [types termmeta='taxonomy-introduction2'][/types] ne '' )"]
[types termmeta='taxonomy-introduction2'][/types]
[/wpv-conditional]
but it display nothing.
so how to improve and make it works ?
Hi, first, I apologize for the delay you experienced. It's not normal, and we're working to catch up quickly. WYSIWYG fields are a somewhat special case. You should add output='raw' to the field shortcode in a conditional clause:
[wpv-conditional if="( [types termmeta='taxonomy-introduction2' output='raw'][/types] ne '' )"]
Please try this update and let me know if you continue to experience issues with this conditional.
hi, Christian,
I had try to use output="raw" before, but it is not working. Would help to give me more option to resolve this issues.
Thanks in advanced.
WilliamMei
You can try the conditional syntax below instead of the Types field shortcode, and apply debugging to see some additional information about the conditional. Please include the debugging information output on the screen if this does not achieve the desired results:
[wpv-conditional if="( $(wpcf-taxonomy-introduction2) ne '' )" debug="true"]
[types termmeta='taxonomy-introduction2'][/types]
[/wpv-conditional]
Dear Cox,
following is debug information:
####################
wpv-conditional attributes
####################
Array
(
[if] => ( $(wpcf-taxonomy-introduction2) ne '' )
[debug] => true
)
####################
Debug information
####################
--------------------
Original expression: ( $(wpcf-taxonomy-introduction2) ne '' )
--------------------
--------------------
Converted expression: ( '' ne '' )
--------------------
and it's not work.
Okay thanks. In this instance, the best way to use the WYSIWYG field in a conditional that tests for an empty value is as follows:
[wpv-conditional if="( empty($(wpcf-taxonomy-introduction2)) )" evaluate="false"]
[types termmeta='taxonomy-introduction2'][/types]
[/wpv-conditional]
sorry, it is not working.
Okay if you're still experiencing problems it's probably best for me to log in and take a look at your wp-admin area to see what's happening. I may need to install the Duplicator plugin to make a clone, then install that clone locally on my own environment for testing. If that's okay with you, please provide login credentials in the private reply fields here. If your site isn't online and available, please follow the instructions here to provide a copy of your site:
https://toolset.com/faq/provide-supporters-copy-site/
Please let me know which WordPress Archive is showing your terms, and where I can see the problem results on the front-end of your site.