Top of page

Animated Thermometer Shortcode

This shortcode is primarily used on the Homecoming website for the class year pages.  Its purpose it to encourage those of a specific class year to help their class reach their donation goal.

If this plugin isn’t already enabled on your website, put in a plugin request using ourĀ Web Request Form.

Shortcode: Animated Thermometer

This shortcode builds an animated thermometer that fills an image with color based on how close the current amount is to the goal. Six attributes are required. If any of them is missing, the shortcode prints an error message instead of the thermometer.

Required Attributes

AttributeDescription
idA unique identifier for this thermometer. Use a different value for each thermometer on a page.
imageThe URL of the image the color fills in behind.
goal_amountThe target amount, as a whole number.
current_amountThe amount reached so far, as a whole number.
heightHeight of the thermometer in pixels.
widthWidth of the thermometer in pixels.

Optional Attributes

AttributeDefaultDescription
directionupDirection the fill animates. Must be up, down, left, or right. Any other value prints an error message.
speed2000Length of the animation in milliseconds.
repeatfalseRepeat the background image rather than showing it once.
starting_bgcolorCCCColor the thermometer starts at, as a hex value with no leading #.
target_bgcolor090Color the thermometer animates to, as a hex value with no leading #.
use_scaletrueShow a scale alongside the thermometer.
scale_divisions10Number of divisions on the scale.
scale_in_dollarsfalseFormat the scale values as dollar amounts.
scale_text_color090Color of the scale text, as a hex value with no leading #.
show_goalfalseDisplay the goal amount.
convert_amountfalseShorten amounts over 9,999 to thousands, so 25,000 displays as 25K.
image_textemptyText shown on the image.
image_overlay_textemptyAdditional text shown over the image.
over_imageemptyAn alternate image used once the goal has been passed.
over_height0Height of the over-goal image in pixels.
over_width0Width of the over-goal image in pixels.
over_bgcolor009Fill color once the goal has been passed, as a hex value with no leading #.
show_calculationfalseIntended to display the calculation. This attribute currently has no effect.

Shortcode

[ wfu_animated_thermometer id=”test” image=”https://prod.wp.cdn.aws.wfu.edu/sites/171/2013/06/donor-2009.png” height=180 width=350 goal_amount=200 current_amount=150 ]

Shortcode Output

150