Here are the screenshots showing that Categories are attached to the post and are correctly displayed in one of the Elementor’s widgets.
And if I use php snippet
<?php
foreach((get_the_category()) as $category) {
echo $category->cat_name . ' ';
}
?>
Both categories get displayed correctly. The only thing I can’t get to work is ACF image field attached to a category.
Alright, I tried what you suggested and here is the output I got:
WP_Post Object
(
[ID] => 2246
[post_author] => 1
[post_date] => 2018-11-19 03:43:12
[post_date_gmt] => 2018-11-19 03:43:12
[post_content] =>
[xyz-ips snippet="Taxonomy"]
[post_title] => ISS Explorer
[post_excerpt] =>
[post_status] => publish
[comment_status] => closed
[ping_status] => closed
[post_password] =>
[post_name] => iss-explorer
[to_ping] =>
[pinged] =>
[post_modified] => 2018-11-20 05:52:17
[post_modified_gmt] => 2018-11-20 05:52:17
[post_content_filtered] =>
[post_parent] => 0
[guid] => http://localhost/?post_type=webworks&p=2246
[menu_order] => 0
[post_type] => webworks
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
[post_title] => ISS Explorer
[post_excerpt] =>
[post_status] => publish
[comment_status] => closed
[ping_status] => closed
[post_password] =>
[post_name] => iss-explorer
[to_ping] =>
[pinged] =>
[post_modified] => 2018-11-20 05:52:17
[post_modified_gmt] => 2018-11-20 05:52:17
[post_content_filtered] =>
[post_parent] => 0
[guid] => http://localhost/?post_type=webworks&p=2246
[menu_order] => 0
[post_type] => webworks
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
I’m confused, but I think you might be right, for some reason it’s not showing any tags that are attached to the post. Correct me if I’m wrong.
Just tried both and it still results in an empty output:
<?php
$term = get_queried_object();
$image = get_field('taxonomy_images', 'term_' . $term->term_id);
?>
<img src="<?php echo $image ?>"/>
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.