Hey fellow L&L aficionados!
I’m playing around with filtering my query using the
field attribute using the syntax documented here. I’m just playing around with dummy content to better understand how this works, but something isn’t working for me. I have a custom “bicycle” post type and each bike has a custom field called “price” which contains a number value. The following markup works:
<Loop type=bicycle field=price field_type=number field_value=1800> <strong><Field title /></strong> $<Field price /><br /> </Loop>
This makes the loop only display two of the bikes which both have a price of 1800:
However, when I try adding the
field_compare attribute, my loop returns nothing. For example, I tried the markup below which (if my understanding of loop filtering is correct) should loop through all posts of type
bicycle that have a
price field with a value greater than or equal to 1700. But when I use this syntax, nothing gets displayed:
<Loop type=bicycle field=price field_type=number field_compare=more_than_or_equal field_value=1700> <strong><Field title /></strong> $<Field price /><br /> </Loop>
Does anyone have any clues about why this might be the case?