WordPress plugin providing a [counter] shortcode to animate a number from 0 up to a
target value.
The animation is triggered on scroll, when the counter enters the viewport (Intersection Observer) — ideal for highlighting key figures on a home page.
- Place
counter-shortcode.phpandcounter.jsintowp-content/plugins/counter-shortcode/. - Activate "Counter Shortcode" from the WordPress Plugins menu.
Insert the shortcode into a page, a post or a widget:
[counter end="100"]
[counter start="0" end="500" speed="0.1"]
| Attribute | Description | Default |
|---|---|---|
start | Counter start value | 0 |
end | Target value to reach | 100 |
speed | Animation speed (the higher the value, the faster) | 0.1 |
- The script is only loaded on the front end.
- The animation starts when 50% of the counter is visible on screen, then observation stops.
- Smooth rendering via
requestAnimationFrame.
WordPress · PHP 7.4+ · GPL2 license