Home › Forums › Front-end Issues › Custom Taxonomy in ACF › Reply To: Custom Taxonomy in ACF
Hi Jonathan!
I switched the return value to Term Object as your reco but the code did not work. Anyways, I fixed it already and here’s my working code:
<?php
/* sub specialty */
if (get_field('sub_specialty') != '') { ?>
<strong>Sub specialty.:</strong>
<?php
$terms = get_field('sub_specialty');
array($terms);
foreach ($terms as $term){
$subspec[] = '<a href="'.$term->slug.'" name="'.$term->slug.'" alt="'.$term->anem.'">'. $term->name .'</a>';
}
echo implode(' / ', $subspec);
; ?>
<br />
<?php } else { ?>
<?php } ?>
I added some codes too according to how I want it to be displayed.
Thanks for replying btw. =]
God bless!! ;]
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.