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!