Last.fm for WordPress
Last.fm for WordPress displays your Last.fm recently listened tracks in your WordPress blog.
- Widget ready
- No options page (yes, it's a feature)
- Uses WordPress resources (no extra files needed)
- Multiple widgets (Thanks to Michael Feichtinger)
Drop the lastfm-for-wordpress folder into /wp-content/plugins/ and activate the plug in.
If you use WordPress widgets, just drag the widget into your sidebar and configure.
If widgets aren’t your thing, use the following code to display your recently listened tracks:
Last.fm for WordPress also has several configurable options. Here’s what you can configure:
- lastfm_tracks('username', [tracks], [list], [timestamp], [linked], [encode_utf8]);
- username: your Last.fm username
- tracks: number of recently listened tracks to show
- list: show tracks in a unordered list
- timestamp: show a relative timestamp
- linked: create a link to each track
- encode_utf8:turn it on if you have encoding problems
Only username is required. The other parameters will take this default values:
- lastfm_tracks('username', 5, true, true, true, false);
This is: 5 tracks, in a list, with timestamps and with links.
So, if I wanted to show my last 5 recently listened tracks, not in a list, with timestamps and with links I would use the following:
- lastfm_tracks('username', 5, false, true, true);
The plug in provides the following CSS classes:
- ul.lastfm: the main ul (if list is activated)
- li.lastfm-item: the ul items (if list is activated)
- p.lastfm-track: each one of the paragraphs (if tracks > 1)
- .lastfm-timestamp: the timestamp span class
- a.lastfm-link: the track link class (if linked is activated)
- Sub Focus – Tidal Wave
- Bastille – Pompeii
- Desire – Under Your Spell
- Calvin Harris – Feel So Close
- The Temper Trap – Sweet Disposition
1.3.1 - 2008/04/17
- Fixed: Invalid HTML with titles with special characters. Thanks aljuk
1.3 - 2008/04/08
- Now using human_time_diff() instead own function: better performance, less code and automagically i18n!
1.2.1 - 2008/04/1
- I messed it up with the encoding. Now works.
1.2 - 2008/03/31
- Added encode_utf8 option in order to (hopefully) fix the encoding issues.
1.1.1 - 2008/02/26
- Small bug fixed. Thanks to Mateus Moraes
1.1 - 2008/01/03
- Multi-Widget Feature. Thanks to Michael Feichtinger
1.0.1 - 2007/09/08
- Fixed some HTML encoding issues. Props to Dave.
1.0 - 2007/08/22
- Initial Release
- Ronald Heft - The plugin is highly based in his Pownce for WordPress, so the major part of the credits goes to him.
- Michael Feichtinger - Contributed the multi-widget feature code
Maybe you could be interested in my other plugins: Code