Home › Forums › General Issues › Link field values (checkbox) with url-s? › Reply To: Link field values (checkbox) with url-s?
I try to remove some lines and done this but got 2 problems.
1st is no commas and space in between text
2nd is the last field comes 2 times
Screenshot: https://prnt.sc/low0fl
<?php
$field_value = get_field('job_qualification');
$field_object = get_field_object('job_qualification');
$services = $field_object['choices'];
foreach($services as $value => $label){
if (in_array($value, $field_value)) {
$servicesList = "<a target='_blank' href='https://jobsalert.pk/edu/$value'>$label</a>";
}?>
<?php echo str_replace(',', ' , ', $servicesList); ?>
<?php } ?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.