I haven’t looked at or tried @mkeys plugin yet, but doesn’t it make you wonder why this hasn’t been implemented, natively, into ACF if Matt Keys was able to write a separate plugin for it? Obviously, this is a massive missing element that would make this feature VASTLY more useful.
Great job, mkeys! Thanks!
The download doesn’t work for some reason. Just keeps reloading the page.
Anyway, your approach seems promising. Unfortunately, I realized I also need the same field to be CONDITIONAL. Meaning I need other fields to be able to be conditional based on its value. Alas, I guess you can’t do that with taxonomy or post fields. 🙁
Oh, the power a dynamic conditional field would give us! And especially if we could dial in the taxonomy level we wanted!
I definitely want them to be able to choose any image and still have a particular order to the gallery. That’s why the first image approach doesn’t work for me. It restricts the gallery order.
I decided to just use the method where I add a separate ACF image field and have the gallery and image field only “see” images uploaded to the post. The user uploads to the gallery and then can select one image from the gallery as the “main image” with the image field. I think this will be the most intuitive way of doing things with the tools I have available.
Yeah, I know they won’t have to upload it twice. Of course, once again, they may still try to do that too! 😀
Rule of thumb to use with lots of users adding and editing content: You cannot trust them to ever do things properly. You have to assume they will find the one way that could possibly exist to do it wrong! 😀
Thanks for the input!
Another way I have thought about doing this is to have a repeater field instead of a gallery. Then I could add an additional field to the repeater that would be a flag for featured image. Unfortunately, I just lose the ease of use of the gallery field then. :-/
The reason I wanted to use an image from the gallery is so the users won’t be confused as to why they need to add the same image twice if they want it to be the featured image and be in the gallery. They’ll all do it differently. One will add it to both places, one will add it to featured image and not the gallery, and another will add it to the gallery and will have no featured image.
I had thought of just using the first image in the gallery. That would be fairly easy, but in some cases, the gallery will need to have a distinct order to it, yet the first image may not be the most representative.
Yeah, that would probably be the fallback if I can’t figure something out. That would be a fantastic new feature to add to ACF galleries. Just some way of flagging one or more images as being “special.” And giving the option of whether one or more could be flagged. That way the theme developer can choose what to do with those special images.
I’ll keep searching/thinking of a way to add radio buttons to the images in the meantime. 🙂
That would be a suitable approach if we weren’t going to have 100s of users editing content. If it were just me, I’d be able to control that and make sure it was always done right. Unfortunately, the user having to type something is a recipe for mistakes galore! 😀
Either they won’t spell it right, won’t put it in the right place, will add it to one photo and forget to remove it from another, etc. etc. I guess a radio button under each photo would be the most fool-proof way of having them choose one to be the featured image.
Unfortunately, I’m pretty new to WP development. I’m sure there’s a way to add in the radio buttons and be able to store the “featured” flag.
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!
© 2020 Advanced Custom Fields. Subscribe