Link to a page where the issue can be seen: hidden link
I expected to see: I expected to see links under the name of most of the artists
Instead, I got: Instead, it's showing me that the conditional logic is somehow not formatted correctly. I had been using this code successfully on another page, but I see now it's not working there either. Did something change in Toolset? This code should work:
[wpv-conditional if="( $(wpcf-facebook-link) ne '' ) AND ( $(wpcf-gallery-link) ne '' ) AND ( $(wpcf-instagram-link) ne '' ) AND ( $(wpcf-website-link) ne '' )" debug="true"]<h5 style="margin-top:0px;">Find [types field='first-name'][/types] online</h5>
[wpv-conditional if="( $(wpcf-website-link) ne '' )"][/wpv-conditional][wpv-conditional if="( $(wpcf-gallery-link) ne '' )"] [/wpv-conditional][wpv-conditional if="( $(wpcf-facebook-link) ne '' )"] [/wpv-conditional][wpv-conditional if="( $(wpcf-instagram-link) ne '' )"] [/wpv-conditional][/wpv-conditional]
Sorry for the slow response, we are having a busy spell.
I reformatted your markup to make it a little easier to see what it is supposed to be doing:
[wpv-conditional if="( $(wpcf-facebook-link) ne '' ) AND ( $(wpcf-gallery-link) ne '' ) AND ( $(wpcf-instagram-link) ne '' ) AND ( $(wpcf-website-link) ne '' )" debug="true"]
<h5 style="margin-top:0px;">Find [types field='first-name'][/types] online</h5>
[wpv-conditional if="( $(wpcf-website-link) ne '' )"]
<a href="[types field='website-link' output='raw'][/types]" title="[types field='first-name'][/types]'s Website" target="_blank" style="margin-right:10px;" rel="noopener"><i class="fa-solid fa-desktop"></a>
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-gallery-link) ne '' )"]
<a href="[types field='gallery-link' output='raw'][/types]" title="Gallery Website" target="_blank" style="margin-right:10px;" rel="noopener"><i class="fa-solid fa-palette"></a>
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-facebook-link) ne '' )"]
<a href="[types field='facebook-link' output='raw'][/types]" title="Follow [types field='first-name'][/types] on Facebook" target="_blank" style="margin-right:10px; margin-left:-4px;" rel="noopener"><i class="fa-brands fa-facebook"></a>
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-instagram-link) ne '' )"]
<a href="[types field='instagram-link' output='raw'][/types]" title="Follow [types field='first-name'][/types] on Instagram" target="_blank" style="margin-right:10px; margin-left:-4px;" rel="noopener"><i class="fa-brands fa-instagram"></a>
[/wpv-conditional]
[/wpv-conditional]
>it's showing me that the conditional logic is somehow not formatted correctly
What do you mean by that? What is it showing you?
You have an outer conditional shortcode which checks if **all* of the custom fields have values and will only output anything if they all do. Might it be that only some of the fields have values and therefore the test fails and nothing is output?
If you look at the link I sent you, you can see that it's showing the debug.
It's acting like none of the records have values in any of those fields, and that's false. Almost every record has at least one of those fields. For instance, here's the debug for one of them, showing clearly that several of the fields aren't empty, yet it's still not showing what I told it to show if they're not empty:
####################
wpv-conditional attributes
####################
Array
(
[if] => ( $(wpcf-facebook-link) ne '' ) AND ( $(wpcf-gallery-link) ne '' ) AND ( $(wpcf-instagram-link) ne '' ) AND ( $(wpcf-website-link) ne '' )
[debug] => true
)
####################
Debug information
####################
--------------------
Original expression: ( $(wpcf-facebook-link) ne '' ) AND ( $(wpcf-gallery-link) ne '' ) AND ( $(wpcf-instagram-link) ne '' ) AND ( $(wpcf-website-link) ne '' )
--------------------
--------------------
Converted expression: ( '' ne '' ) AND ( '' ne '' ) AND ( 'hidden link' ne '' ) AND ( 'hidden link' ne '' )
--------------------
The converted expression you shared is following:
Converted expression: ( '' ne '' ) AND ( '' ne '' ) AND ( 'hidden link' ne '' ) AND ( 'hidden link' ne '' )
I see you are using AND clause so all conditional expression you added to conditional statement should satisfy and then and then it should display the result.
AS you can see the first expression:
- ( '' ne '' ) - this is false (AND)
- ( '' ne '' ) - this is false (AND)
- ( 'hidden link' ne '' ) - this is true (AND)
- ( 'hidden link' ne '' ) this is true (AND)
As you are using AND clause that means it will display the result only when all expression "true" but as you can see first two expression is false so it will not display the result.
Can you please check the values for your custom fields and make sure if all the fields has desired values added and then again compare the conditional statement.
My code says that if any of those have a value, then print what I said to print. So, clearly two of them have values. Is there a different way to check to see if any of the fields have values?