Brilliant – thank you Elliot!
Loads simpler than anything else that I’ve seen!
Hi Elliot,
Brilliant! Thank you for your help on this, works a treat!
Although, I had to wrap the second $value (that displays the text for the link) in the single quotes and full stops to get it to render the text correctly:
<?php
$values = get_field('regions-listed-in');
if($values)
{
foreach($values as $value)
{
echo ' <a href="http://test/inhouse1/explore/' . $value . '">' . $value . '</a>';
}
}
?>
Hi Elliot,
Thanks for the response.
Yup, there will often be multiple values selected, and I’d like them to point to different URLs.
For example, if there are 5 regions available in the checkbox list (a – e), and Joe works in 3 of them (a, b and d) I’d like the output to be:
“Joe is available in: a b d”
with the a b and d text linking to the respective area pages (http://test/inhouse/a, http://test/inhouse/b and http://test/inhouse/d)
If Jane only works in area c, then the output would be:
“Jane is available in: c”
with the c linking to http://test/inhouse/c
Cheers,
Lerq