I am wondering if it is possible to set an image from the ACF gallery as the “featured image” of a post. It doesn’t have to be the WP featured image, just some way of flagging one image in the post edit screen that will allow me to set it as a featured image visually on the front end yet still be part of the gallery.
Right now I have a gallery and the WP featured image, but I would like the images to be unified in one area on the admin edit screen and then give the user the ability to select one image in the gallery to be “special.”
Has anyone ever done something like this? If not, I’m interested to hear other ideas that are similar.
it depends on:
the most easy thing is for sure to have a additional Image field (not required) where user can select that image. (optional create a filter or savepost action to set WP featured image to that field)
also easy would be to use the first image of the gallery when additional yes/no field after gallery is set to true.
a little more difficult would be to get a random, or the last image of the gallery.
possible but probably not failsave is to let user select or type the image countnumber. and use that if possible, else use first image.
if you are good at coding:
create a additional fieldtype that create a drop-down with image and filename out of the gallery (something that works like relationship but for gallery) probably done with js
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.
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.
it is just a matter how you label that image-field and what description text you set, and that it is after the gallery-field.
also user don’t had to re-upload image, he should just “re-select” a already uploaded image. if you only show images uploaded to that post (for gallery and for featured image) it should be no problem and not confuse,
if gallery dont have 50+ images it will be also relative easy to use.
but that my humble opinion, if you dont think so i have no problem with that
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!
i too think this would make things easier. Having a little toggle star on each thumbnail in the gallery to set that image as the featured image would make it easier for users & clients.
There was a feature like this in File gallery but generally that’s not as nice as ACF gallery fields.
Making it easier to use for the client is the developers responsibility. I’ve always used the first image is the featured image rule mentioned by @mediawerk and I’ve never had a client that was confused by this, but then again I’m rather verbose when I write field instructions. I spell everything out for them, where the images will be used, what size they have to be, what will happen if they don’t include anything.
You must be logged in to reply to this topic.
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!