Counter Shortcode
WordPress plugin — animated counter shortcode
by Arro38 · github.com/arro38/wordpress_counter_shortcode · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/arro38/wordpress_counter_shortcode/archive/refs/heads/main.zipWordPress 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.
Installation
- Place
counter-shortcode.phpandcounter.jsintowp-content/plugins/counter-shortcode/. - Activate "Counter Shortcode" from the WordPress Plugins menu.
Usage
Insert the shortcode into a page, a post or a widget:
[counter end="100"]
[counter start="0" end="500" speed="0.1"]
Parameters
| 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 |
How it works
- 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.
Compatibility
WordPress · PHP 7.4+ · GPL2 license