Home › Forums › General Issues › images as choices in select field › Reply To: images as choices in select field
Thank you for your help!
I was thinking of an if statement as well, but know that the selection field might grow to a lot of options, like 50+ easily. This means I will get a huge if statement, wouldn’t that be a problem?
Ah wait, I just found an option. If I name all my pictures “logo-brandname.jpeg” I can make a map in my /images folder with brand logos. then I can just upload the pictures to that map, e.g. “logo-coke.jpeg”, “logo-apple.jpeg”, “logo-sony.jpeg”
If I then make sure that the select field options match the brand name in the filename I can just use <img src="/images/brand/logo-<?php the_field('reviewBrand'); ?>.jpeg">
right? that would be very convenient!
Thanks for helping me on this!
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.