Adding Custom Status Note to Display
-
Hi Chris!
I’ve been working with your Stream Data plugin and my client would like to add a “Status” line that states whether the stream is at the right level to kayak/canoe. I got half way there adding code to the usgs.php file in my child theme. I was able to successfully display different info based on the $gageheight value. The problem is that the water level data for low, good, and high is different for many streams. So, my thought was to add elseif variations by location. But, the following code doesn’t seem to be recognizing location the way I have it written. I’m sure there’s a better way to code this, but here’s what I have. Any suggestions?
if($location = '01541500,01546400' && $gageheight ['value'] < 4.6){ echo "<li class='%s' style='color:#279ae0;'><strong>STATUS:</strong> Too Low to Go <em>(under 4.6ft)</em></li>"; } elseif($location = '01541500,01546400' && $gageheight['value'] >= 4.6 && $gageheight['value']<= 6){ echo "<li class='%s' style='color:#1fab40;'><strong>STATUS:</strong> Perfect for a Cruise! <em>(between 4.6ft & 6ft)</em></li>"; } elseif($location = '01541500,01546400' && $gageheight['value'] > 6){ echo "<li class='%s' style='color:#e90915;'><strong>STATUS:</strong> Too High to Ride <em>(above 6ft)</em></li>"; } else { echo "<li class='%s'><strong>STATUS:</strong> Unknown</li>"; }If this would require a crazy amount of work – too much to explain, I’d understand. 🙂
Thanks in advance! -Erica
The page I need help with: [log in to see the link]
The topic ‘Adding Custom Status Note to Display’ is closed to new replies.