Home › Forums › ACF PRO › Get link from taxonomy field › Reply To: Get link from taxonomy field
Found my solution here:
<?php
$args = array( 'hide_empty' => '0');
$categories = get_categories($args);
if($categories){
echo '<ul class="product-categories">';
foreach($categories as $category) {
echo '<li>';
$link = get_field('category_link', 'category_'.$category->term_id);
echo '<a href="'.$link.'"><span class="cat-title">' . $category->name . '</span></a>';
echo '</li>';
}
echo '</ul>';
}
?>
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.