Hi all
I’m using the checkbox field with choices like this.
http://www.goggle.com : Google
http://www.yahoo.com : Yahoo
http://www.bing.com : Bing
http://www.dogpile.com : Dogpile
I would like to display the choices selected in WordPress in ‘li’ list like
If Google and yahoo were selected.
<ul>
<li><a href="http://www.goggle.com">Google</a></li>
<li><a href="http://www.yahoo.com">Yahoo</a></li>
</ul>
How would I do this?
Ok I’ve worked out how to get the value in the link but how do I get the label
<ul>
<?php
$link = get_field('mt_web_fonts');
for($n=0; $n<count($link); $n++){
echo '<li>';
echo '<a href="'.$link[$n].'">label</a>';
echo '</li>';
}
?>
</ul>
Hi @ttmt
You can see how to load the field object and find/match the choices/labels here:
http://www.advancedcustomfields.com/resources/functions/get_field_object/
Thanks
E