I make WordPress and MyBB plugins on request! Check my Plugin Development page.

How to Show Last.fm Tracks In Your Blog

Stuff I use,WordPress 9 January 2010 | 2 Comments

So you have a WordPress blog and you want to show your latest tracks from Last.fm in your sidebar? Then Last.wp is the plugin for you. It works through JavaScript (no server overhead each time you load a page) and it displays song names, artist names, album names and even album artwork.
This is by far the best Last.fm plugin for WordPress I’ve ever tried.

What Do You Need to Run It

There are some requirements for this plugin to work correctly.
First of all, of course you must have a WordPress blog running with a widget-enabled theme. Then you need a Last.fm profile, preferably with some good charts (you don’t want to get your users horrified at your musical taste).
Last but not least, you need a Last.fm API key associated to your account. In order to get one, just log into Last.fm and visit this address: http://www.last.fm/api/account. Once you have obtained your key, copy and paste it somewhere for later, when you’ll have to enter it in the plugin’s settings.

Widget Setup and Settings

Upload the lastwp directory into /wp-content/plugins/, then activate the plugin in the Plugins section in your wp-admin. Now that Last.wp is active, go to the Widgets section under Appearance. Drag and drop the Last.wp widget in your preferred sidebar on the right, then expand it to show the plugin’s settings.

Here you have to enter the widget’s title, your Last.fm username and, most importantly, you have to paste the key you have obtained earlier in the Last.fm API key field. Then you can choose how many songs you want to show in your sidebar through the dropdown menu.
Once you’re done tweaking the settings, click Save.

That’s it. You should now see your latest tracks from your Last.fm account in your blog’s sidebar. Enjoy a cup of coffee or tea while scrobbling some of your favourite tracks.

Last.fm Widget Customization

You can customize how your Last.fm widget looks by editing the lastwp.css stylesheet, under the “css” directory in the plugin’s folder. If you are familiar with CSS, this should be quite a straightforward task.
The lfm_overlay.png image is shown at the bottom right corner of the album artwork, and by default it’s a tiny green music note. If you want to customize it, you can either replace the existing image or edit the path in the CSS file, in the .widget_lastWP div.lfm_art a block.
Another thing you could change is how the fonts for song name, artist name and album name look. These are defined respectively by the div.lfm_song, div.lfm_artist and div.lfm_album classes.

Visit the plugin’s author website and the plugin’s page.

Tagged in , , ,

2 Responses on “How to Show Last.fm Tracks In Your Blog”

  1. This is crazy exciting for me =) Wow, you’ve even got the documentation down worlds better then I did! Thanks man!

  2. and don’t forget http://wordpress.org/extend/plugins/qtwit, it works the same way (Via the jQuery tweet plugin)

Leave a Reply