Home › Forums › Front-end Issues › Replace featured image with taxonomy image › Reply To: Replace featured image with taxonomy image
You have 2 choices
1) When the post is saved, using an acf/save_post filter https://www.advancedcustomfields.com/resources/acf-save_post/. Get the tax/term that the new post is saved to, get the image set for that tax/term, update the post thumbnail. I’m not going into much detail here because I would not do this. The main reason is that the image could change at any time and this will not retroactively update old posts if the image for the tax/term changes.
2) Modify the templates where the featured image is shown and instead of showing this get and display the image for the term. This is what I would do. This can also be modified if you want to allow a different featured image as well as a default. Get the post thumbnail, if there is one then show it, if not then get the term image and show that.
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.