Amazon Wishlist Updated Again
I’ve added some functionality to the Amazon Wishlist plugin that allows the user to define where to display the output. As in the initial version, the output can be displayed immediately after the category listing. This option will be best for those not inclined to edit their templates in any way. The second option is to invoke a function named “get_amazon_wishlist()” within any template to display the information.
In order to display the book information as a coda to the category listing, one need only edit the plugin’s first line of uncommented code:
[php]
$aw_show_after_cats = 0;
[/php]
Setting this variable to 1 causes the book to be displayed automatically after the category listing.
Leaving the variable set to 0 suppresses the automatic display of the book. If you wish to apply the plugin to your templates manually, you’ll need to edit wp-includes/template-functions-general.php to add the following function:
[php]
function get_amazon_wishlist(){
echo amazon_wishlist(”");
}
[/php]
Optionally, you could also just add the following inline within your template:
[php]
echo amazon_wishlist(”");
[/php]
Both methods simply call the plugin function.
The revised plugin can be downloaded from the original url, here.
Geof said,
July 15, 2007 @ 6:33 pm
Eeeeeexxxxxcellllent.
This is what I was going to try to run down a how-to tonight.
For anyone editing a WP functions document, I suggest either making a subdir in that folder called “hacked” and saving a copy of both your hacked file as well as the original, unhacked file [for diffing purposes, ya see] -or- making your own .patch and saving it in that dir.
Ken Scott said,
July 15, 2007 @ 6:33 pm
Daryl,
I have created a small patch to your Amazon wishlist plugin. This patch displays the artist, if desired, the same way the author is displayed.
I found that in your plugin, that CDs only had the title and price, and not the artist, so I fixed it.
Let me know where to contact you to send the patch to you.
Thanks,
Ken Scott
pv3 » amazon wishlist Plugin working! said,
July 15, 2007 @ 6:33 pm
[...] go by pv3 in General As already mentioned in a previous article I found a really cool plugin, that would allow me to display a random article from my amazon wishlist. Unfortunately [...]