IF and Variables
-
Hi all. I’d really appreciate some help with the scenario below, as I can’t understand what I’m doing wrong:
– Context:
Custom post type “Articles”
Custom post type “Companies”When I write a new article, I can specify a “company” for it, via an ACF relationship.
On the page of each “company”, I want to show the list of all related articles, using this plug-in in the template.
So the following appears on the “Company” page:——————————————
[set thiscompany][field title][/set] [loop type=post count=5] [set companyinarticle][related acf_company][field title][/related][/set] [pass vars] Passed variable "companyinarticle": {COMPANYINARTICLE}<br /> Passed variable "thiscompany": {THISCOMPANY}<br /> [if pass='{COMPANYINARTICLE}' value='{THISCOMPANY}'] <a href="[field url]">[field title]</a> [/if] [/pass] [/loop]
——————————————
The two passed variables appear correctly in my two debug lines, but the IF condition does not.
In fact, even if I simply say [if pass='{COMPANYINARTICLE}’]something[/if], nothing will happen.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘IF and Variables’ is closed to new replies.