I’m completely open on how to do this:
I have the line:
echo implode(', ',get_field('categories'));
Which is outputting this:
Branding, Web, Print
I have 20 or so options it can output depending on what checkboxes were ticked.
At the moment, what it’s outputting is just plain text. How can I make each tag a link? The link would need to be unique per tag so:
<a href="tags/design/branding">Branding</a>, <a href="tags/design/web">Web</a>, <a href="tags/marketing/print">print</a>
UPDATE:
This is what I have working currently, it’s slightly different to your’s but again it has the same problem of not being able to differentiate between the design or marketing link, here’s the test page:
<?php
$categories = get_field('categories');
$elements = array();
foreach($categories as $category) {
//do something
$elements[] = '<a href="/tags/design/' . strtolower($category) . '" title="' . $category . '">' . $category .'</a>';
}
echo implode(',', $elements);
?>
This creates the links: