Hi People, I am using a “Select” field that allows me to select multiple values. I understand how to use the “Implode” (that was given in the documentation part of this site) to show them as a list separated by a comma. My goal is to have the values bring up a list of images that have the value as the file name.
From my multiple value lise select field I select : ‘House’ ‘Dubstep’ ‘pop’ ‘Hip hop’
<?php echo implode(‘, ‘, get_field(‘page_layout’)); ?>
Using the implode function I get in a comma list: ‘House, Dubstep, pop, Hip hop’
I want to use php to bring Icons representing those names instead from my style sheet directory.
so it will be *’directory’/House.Jpg*,*’directory’/Dubstep.Jpg*,*’directory’/pop.Jpg*, *’directory’/Hip Hop.Jpg*
I want it like this because there are more values to select so I want it to load different images depending on what I select in my custom field.
I have tried to play around with Echos and arrays but I have no luck. . Please note that i will be using the <?php bloginfo(‘template_url’); ?> to get the style sheet.
- The topic ‘Multiple values field into a list of images with each having *value*.jpg’ is closed to new replies.