Home › Forums › General Issues › Category Images not displaying › Reply To: Category Images not displaying
I know this thread is aging, but any help would be greatly appreciated.
I have a similar problem, which I cannot seem to locate a solution for in the documentation or forum, but this looks as close as I can get so far.
I have a default category.php template and have added the following code to it to display my category icon, which works on the index.php page of my site just perfectly.
<?php
$args = array(
'orderby' => 'name',
'order' => 'ASC'
);
$categories = get_categories($args);
foreach($categories as $category) { ?>
<?php echo $image_url=the_field('event_type_category_icon', $category); ?>
<img src="<?php echo $image_url=the_field('event_type_category_icon', $category); ?>" />
<?php }
?>
But when I want to display the specific category icon on its coordinating category page, it displays an image ID instead of the image URL (which would reflect the image itself) and shows that the image is coming from the actual /category/ directory as well which is not true.
Please help!
Michael
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.