Instructions
On Using Last.fm Artists
You can either use the widget or the following methods to use Last.fm Artists.
Put Last.fm Artists in you Post/Page
If you want to put it in a post or page, use (minus the spaces):
{ lastfmartists }
and this will display your settings. If you want to override those settings, use (minus the spaces):
{ lastfmartists | number | time | size | type }
You can leave off any subsequent setting that you don’t want to change. For example: if you just want to change the number, only go up to the number setting. However, if you want to change the size, then you must also enter the number and time. If you want to change the time, you must also enter the number. The option type refers to whether the image is wide or square. Square is the default setting.
Put Last.fm Artists in you Design
For a non-widget display, put the code
<?php lastfmartists_display(); ?>
anywhere in your template and it will show your settings. If you want to override the settings on the setting page, use
<?php
$args = array(
'time' => 'the time period',
'number' => 'number of images',
'size' => 'size of images'
'type' => 'wide or square'
'display' => 'yes or no'
);
lastfmartists_display($args);
?>
in your template. The time has to be either weekly, 3month, 6month, 12month, overall, recent, or loved or else overall will display by default. The display option tells the plugin whether to display the artist’s information or not. You can leave any of the arguments out that you don’t want to change from you overall settings. For example, if you want the size and display to be the same, use:
<?php
$args = array(
'time' => 'the time period',
'number' => 'number of images'
'type' => 'wide or square'
);
lastfmartists_display($args);
?>
and the size and type argument will match what you set in your settings page.
Styling Last.fm Artists
CSS can now be directly edited in the plugin admin page. You can select from several pre-built styles or edit your own and will show up as custom in the menu later on. If you want to permanently save your own style, copy and paste the style into a blank file and save it something.css with something being whatever you want it to be called. They you can just upload the style into the plugin directory and it will appear in the select menu automatically.






Comments:
Great plugin and idea, I just can’t seem to get the styles working.
They don’t seem to be applying to the images themselves. This is confirmed by using Firebug and checking them individually.
WordPress 2.7
Thanks,
Dave
January 27, 2009 at 2:36 am
It’s not obvious to me where my last.fm userid goes?
March 7, 2009 at 1:24 pm
Duh! Forget my last comment, I just found the configure section for the Plugin under the Plugins section of the dashboard! Thanks for the plugin.
Mick
March 7, 2009 at 1:29 pm
Hi Gary, i want to use the plugin (or parts of it) for playing artist-information on/for a concertlist for my hometown. How can i do this? Maybe its also a good inspiration for you?!? Thanx
April 7, 2009 at 9:29 am
i want show twice artist, but i don’t no, you can help?
June 21, 2009 at 7:56 pm
I’m not exactly sure what you’re asking. Do you want two Last.fm charts or do you want to display an artist twice? For the latter, you can’t. For the former, you cannot have multiple chart through widgets so you would need to add other charts by pasting the above PHP code into your layout.
June 23, 2009 at 7:24 pm
Hi, I want display an artist twice, but now the plugin show 1 picture for 3 songs of the same artist, i want show 3 pictures.
you understand me?
June 24, 2009 at 10:48 pm
You can’t do that. The way I wrote the plugin was that it would only tdisplay an artist once, skipping over any entries that contained the same name. You could, however, try uploading replacing the “lastfm.php” in the Last.fm Artist folder with this one:
http://finalstar.net/wp-content/uploads/2009/06/lastfm.zip
That removes the duplicate artist check but I’m not sure how well it will work because I wrote the rest of the plugin with the idea that an artist will not display more than once.
June 26, 2009 at 5:44 pm
I am very grateful, it worked!
verry thanks!
July 15, 2009 at 9:20 pm
Hi Gary, this is a great wee widget, thanks. I have a question regarding the info displayed alongside the album artwork – is it possible to show the song title as well as the name of the band? I’m hardcoding into my template. Cheers.
July 17, 2010 at 8:58 pm
@katri – It’ll be in the next verison of Last.fm Artists. Right now, there is no way to do it.
July 26, 2010 at 5:24 pm