Home › Forums › Front-end Issues › Featured Image on Category.php › Reply To: Featured Image on Category.php
That’s only the code for registering the field group. In your category template you need to add code to get the field, the exact code will depend on how the image field is set up and how you want to display it. To get the value of the field would be something like this
$queried_object = get_queried_object();
$term_id = $queried_object->term_id;
$image = get_field('categories_featured_image', 'category_'.$term_id);
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.