<If>with taxonomy / taxonomy field values

I think the idea of needing to use loops is that you need to tell WordPress where to look for the data you want to work with. If you use the If tag within a post, L&L is smart enough to know that you probably want WordPress to look through the fields of whatever post you’re currently on, so no need to specify where it should look. On the other hand, if you’re writing some markup on the home page and you want to use the If tag to compare some data from somewhere else on your site, you’ll intuitively know that you need to wrap that If in a Loop so that WordPress knows where to look. I think adding “code shortcuts” as you suggested is sometimes worthwhile, but I think it’s also risky because by creating shortcuts, you can sometimes lose sight of what the code you’re writing is actually doing and, as a result, end up writing bad or inefficient code.

In the example you showed, you’re not actually comparing the fields of the current post, you’re comparing the fields of a taxonomy that happens to be applied to that post. The taxonomy fields aren’t stored within the post itself, so you need to tell WordPress where to look for those taxonomy fields by wrapping your If statement inside a Loop.

I’m not sure exactly how your property-city and zoning taxonomies or terms are set up so this might not be exactly what you’re trying to achieve, but I’m pretty sure this would be the most logical way (to me) of looping through the property-city taxonomy terms and setting a variable if the term’s “autozone” field is “Yes”:

<Loop taxonomy=property-city post=current>
  <If field=autozone is value="Yes">
    <Set name=autozonetest><Field autozone /></Set>
  </If>
</Loop>

Also:

took me a while to figure out that rather than using compare=“is” you now use is=“Yes”

I don’t think that’s right. I’m not very familiar with CCS myself, but the L&L documentation suggests that you can just use the comparison is by itself, but there’s no indication that you can add a value to that comparison. I just tried writing some L&L using is="some_value" and that syntax didn’t work. The syntax that follows the documentation would be is value="some_value".

I hope that’s helpful, let me know if I was totally off-base in my understanding of what you were trying to accomplish :stuck_out_tongue: