Home › Forums › General Issues › Using first gallery image as the featured image… › Reply To: Using first gallery image as the featured image…
Using PHP will only work when you click the update button and will not assign the image to the featured image when you do so. I would call this working as expected.
If you want to have the first gallery image automatically populate in the featured image before updating the post then you’ll need to build custom JavaScript to do this. https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/
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.