- A widget to get the latest rides of any athlete or club.
- A short code “ride” to allow you to display more information about a specific ride and a map with the trace of the ride. NOTE: The Strava API states that the tokens they provide do not expire, but they indeed expire so the shorcode functionality to display the map will stop working after your token expire, the only workaround is to login into your admin pages and enter your password again to generate a new token.
- Last a small configuration page to obtain your Strava token to allow you to pull details of your rides.
- This plugin is written completely in objects, so it needs that you run your wordpress installation on PHP 5.3+.
- I’ve tested this plugin with the latest wordpress 3.1+, please report any issue.
- For this plugin to work, you need to have fun riding and use the excellent Strava service.
1. Download latest plugin version and unzipped it into your wordpress plugins folder.
2. Access to your Settings -> WP Strava page and put your Strava email and password (your password won’t be saved and will be sent to Strava using https) to get your token.
3. Configure your widget settings accessing Appearance -> Widgets (the widget name is Strava Latest Rides).
4. Use the “ride” shortcode on any post or page.
- Moved all the code to https://github.com/cmanon/wp-strava/
- Fixed an issue with club search for the widgets reported by Tom.
- Tested up to wordpress 3.3.2.
- Refactored some code to be more efficient.
- Enabled the shortcode for showing map on posts and pages.
- Added a feature request from Tom to add athlete name if the widget is showing club rides.
- Added configurations for metric/english system both on the widget and the shortcode options, for the shortcode use the option som=”english”.
- Initial Release
The “ride” shortcode accept four arguments:
- id: required. It is the ride identifier.
- som: optional. Sistem of measurement, by default if not specified is metric system, the other system supported is “english”.
- map_width: optional. This is the with of the map that will be shown in the post or page, and basically is a css property so, it accept any css with value, default value is “100%”.
- map_height: optional. This is the height of the map that will be shown in the post or page, and basically is a css property so, it accept any css height value, default value is “400px”.
- threshold: optional. It’s a parameter to the Strava API to discard “uninteresting” points in the map in the “threshold” value in meters, default value is “0″.
If you would like to customize the way the html output work, you need to edit the css file included in the plugin main directory css/wp-strava.css.
With all options:
[[ride id=912928 map_width="500px" map_height="200px" threshold="15"]]
- The plugin is prepared for multilingual support, just need to create and include the .po file to add more translations, now works just in english.
You can contact me for any issues with the plugin. Have fun riding!