Hi there,
I've set up two views: one view gets a list of taxonomy terms from a specific taxonomy. The second (child) view gets a list posts with that taxonomy term and creates a slider.
Here's a conditional in the child view that is trying to detect the presence of a specific taxonomy term:
[php]
[wpv-conditional if="( CONTAINS(#(curatorial-category),'2023 International Creative Aging Summit') )" debug="true"]
<div class="homepage_curatorial_category_resource_grid international_creative_aging_summit_2023">
[/wpv-conditional]
[wpv-conditional if="( NOT(CONTAINS(#(curatorial-category),'2023 International Creative Aging Summit')) )"]
<div class="homepage_curatorial_category_resource_grid">
[/wpv-conditional]
[php]
This conditional is located inside a <wpv-loop> tag.
What it's doing, or trying to do, is looking for a specific taxonomy term ("2023 International Creative Aging Summit") in the taxonomy named "curatorial category." If the term is present in this iteration of the loop, the div will include an extra class.
At the moment, two curatorial category names are including the extra class:
+ 2023 International Creative Aging Summit (correct!)
+ Research (NOT correct)
I've reviewed the debugging output from the condition, and here it is for the two matching categories:
1. 2023 International Creative Aging Summit (correct!)
####################
wpv-conditional attributes
####################
Array
(
[if] => ( CONTAINS(#(curatorial-category),'2023 International Creative Aging Summit') )
[debug] => true
)
####################
Debug information
####################
--------------------
Original expression: ( CONTAINS(#(curatorial-category),'2023 International Creative Aging Summit') )
--------------------
After matching 2 numeric strings into real numbers: ( CONTAINS(ARRAY('2023-international-creative-aging-summit',1954,'2023 International Creative Aging Summit'),'2023 International Creative Aging Summit') )
Matched '1954' to 1954
2. Research (NOT correct)
####################
wpv-conditional attributes
####################
Array
(
[if] => ( CONTAINS(#(curatorial-category),'2023 International Creative Aging Summit') )
[debug] => true
)
####################
Debug information
####################
--------------------
Original expression: ( CONTAINS(#(curatorial-category),'2023 International Creative Aging Summit') )
--------------------
After matching 2 numeric strings into real numbers: ( CONTAINS(ARRAY('2023-international-creative-aging-summit',1954,'2023 International Creative Aging Summit','research','1646','Research'),'2023 International Creative Aging Summit') )
Matched '1954' to 1954
After matching 5 numeric strings into real numbers: ( CONTAINS(ARRAY('2023-international-creative-aging-summit',1954,'2023 International Creative Aging Summit','research',1646,'Research'),'2023 International Creative Aging Summit') )
Matched '1646' to 1646
It seems as if an array is being substituted into the conditional expression. I really only need the taxonomy term name. It also appears to be the case that in the second instance, *two* taxonomy terms are present in the conditional. I don't understand why that's happening, it's not what I was expecting / supposed to happen.
My objective, to be clear, is to loop through the list of taxonomy terms and check if one of the terms is "2023 International Creative Aging Summit."
Can you offer any guidance?
Thank you.
Saul