Display images according to the selected value
-
Hello there,
I am using advanced custom fields plugin and I created a custom field with the name recommendation it is a SELECT field type and it has 5 choices. What I am currently trying to figure out is that how can I display different images according to the selected choice.Say for example I select the first choice then an image will be displayed on my post instead of the word inside the selected choice, then if I again select the second value a another image will be displayed which is only for the second value and so on. It is like a rating that I am trying to do. I tried this code<?php $value = get_field('nameofmyselectfield') if($value=='Highly Recommened') { echo <img src="link of my image here"/> } else if($value=='Recommended') { echo <img src="link of my image here"/> }and so on, the same thing with different value for up to 5 times, but my page gave me a white page error.
I am quite new in php so I have less knowledge on it. Anybody could please help me out?Thank you very much
This is the plugin that I am referring to http://wordpress.org/extend/plugins/advanced-custom-fields/
The topic ‘Display images according to the selected value’ is closed to new replies.