I run a news and review website using wordpress and I need some help, when reviewing items on our site we do a score our of 100% on our custom fields, the custom field is titled "Score" and in the box we write the % ie. 95%...
What we want to do is change the colour of the score on the website dependant on what the score is ie. 1%-25% would be red, 26%-50% orange, 51%-75% light green and then 76%-100% in heavy green thus giving the users a colour chart to follow alongside the score.
The code I'm using at the moment to pull the custom field data is as follows...
<div class="reviewscore"><?php $values = get_post_custom_values ("Score"); echo $values[0]; ?></div>
If anyone could help me with this I would be extremely grateful!
Thanks for your time.
remove the % then if(percentage < 25){ use colour X } else if (percentage < 50){ use colour Y } else if (percentage < 75 ){ use colour Z } else { use that other colour }– Tom J Nowell Aug 28 '12 at 13:17