HowTo – Last.Fm Records WordPress Plugin Widget

Filed under: Wordpress Tips

wordpress_logoRecently while helping someone setup a site I had a chance to work with the Last.Fm Plugin written by Jeroen Smeets.

The idea of the plugin is to allow you to put a sidebar widget of your Loved and favorited songs that you listen to on Last.fm

To enable the plugin you need an account on Last.fm and you need to set values in your account to populate the widget. For instance if you wanted to show all the songs that you have selected as Loved you need to do that in your last.fm account and then select that option in the plugin options page.

Once you setup what images from songs you listen to you want displayed on your sidebar you can select the widget from your Appearance / Widgets setup and drag it where you want it to be or you can insert the PHP code to call the widget where ever you might want it on your page.

You might want to place it on your home.php front page or in a categories page and you would insert it using the following.

<?php lastfmrecords_display(); ?>

The major drawback we found that can be overcome in a new version or with some heavy editing by the enduser is that you can not display a few of these widgets to have a Loved and RecentĀ  widget displayed.

We also had some problems with our permalinks hooking to Last.fm.

To overcome this you will need to edit the php of the widget and alter all of the references to how the plugin loads the widget and the options page by renaming constants.

It can be done but its not fun.

Other then that it seems to work pretty well and will automatically update your wordpress site when you are adding songs in last.fm

If you need something like this visit

http://wordpress.org/extend/plugins/lastfm-records/