July 25, 2025 at 11:48 am
I’m trying to replace a city name based on the city name “being part of” the URL. For Example:
The text is:
Serving {city-state}
The URL is:
*Login to see link
Result is:
Serving Tampa FL
I have a bunch of city-state, so I just want to one line, not repeat the line N times and use the Kadence URL conditional display approach as it’s inefficient
Some PHP code to look for and extract the string would likely work, but I need a simple IF statement that matches the {city-state} in the URL with any entry in an ACF or similar table, and then replaces the {city-state} parameter with the matching field value. Is there a way to achieve this within Kadence or with Kadence plus another plugin? Any other ways to pull this off in a simple fashion? I’m not an expert on PHP or Java, but links to any examples that pull this, or are close to this, would be appreciated. If Kadence can’t do this, it would be a killer feature IMHO.
Thanks in advance!
Ken