Home › Forums › Front-end Issues › Display image-field in custom menu › Reply To: Display image-field in custom menu
Hey Elliot,
Thank you so much, I got it working!
I feel like I did it a bit dirty, but I got it working exactly as I wanted. Code for future reference to anyone who needs it:
$items = wp_get_nav_menu_items('radiozenders');
foreach((array) $items as $key => $item) {
$taxonomy = $item->object;
$term_id = $item->object_id;
$url = $item->url;
$title = $item->title;
echo '<li><a href="'.$url.'" title="'.$title.'"><img src="'.get_field('icoon', $taxonomy._.$term_id).'" /></a></li>';
}
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.