Need a WP Amazon plugin that fits some specific specs
July 16, 2008 4:33 AM   Subscribe

Looking for a Wordpress plugin to display, in every post, n Amazon links from a given list. They should chosen based on the post's content.

So, we've got a big list of books on the topics that our blog covers. I'd like to include, say, two Amazon affiliate links at the bottom of every post to them, but obviously it's important that the books match the topic of the post. Is there a good way to do this automatically? I've looked around the WP plugin database, and nothing looks quite right... maybe the best is AzLite, but it's now unsupported.

Oh, book cover thumbnails would be awesome.

A couple ideas I've had:
  • Work each title into a that wouldn't display on the main page, categorized as "Books", and then use a "Related posts" plugin to select only from the "Books" category. Downsides: requires a lot of manual Wordpress hackery and sorting; no thumbnails.
  • Categorize the list of books using the same taxonomy as the blog's categories. Write a plugin that will select from such database, and display a couple randomly chosen books that match the post's category or categories. Downsides: way beyond my skills; hard to update the database with new books.
I'd really like to avoid a manual solution (i.e., choosing books from the big list and adding them to each post by hand), because this blog has many authors and the list of books is constantly expanding — not everybody will be familiar with every title on the list.
posted by electric_counterpoint to Computers & Internet (4 answers total) 2 users marked this as a favorite
 
The simplest way i can think of is to use the alinks plugin to replace words with links.

You might want to search for a more generic solution, e.g. a plugin that will search posts for specific code and replace it with html.
posted by softlord at 5:30 AM on July 16, 2008


Response by poster: Softlord: Thanks, but I should have been clearer: I don't want to link individual words or phrases automatically, I want to automatically include a couple of links to books at the end of each post. Definitely still an advertisement, but something closer to a "Possibly related posts" section than Snap or Kontera links.
posted by electric_counterpoint at 5:44 AM on July 16, 2008


Amazon Associates can build widgets that will load context sensitive content dynamically right their on the build links page - No need for 3rd party tools or anything.

Sign up for an account and have a look at the huge range of options they give you, and then just drop the code they give you into the correct location.

If your theme is widget enabled, just use the text/html widget and put the amazon code in that and you don't even need to hack the source.

It's that easy.
posted by paulfreeman at 6:36 AM on July 16, 2008


Part of this is easily doable. I did something like that on my boeklog, but not with a single plug-in. [moderators, excuse the blatant self-link; it's necessary as an illustration. Most people here won't read Dutch anyway.]

What I did, was to use to link the thumbnail of the book to the Wordpress post, by adding its location as a metadata in a custom field;

Once you have these post with custom fields, there are several ways to call them by the content of those custom fields.

In my case, that custom field is called "article_thumb", and I added this code underneath the loop. It calls random post from category 43, which in my case is the category of favourite books. Mind you, the "random=true" is custom code, and it depends on which version of Wordpress you use, how this function is called.
<?php query_posts('showposts=6&cat=43&random=true'); ?>
		<?php while (have_posts()) : the_post(); ?>
		<?php $image = get_post_meta($post->ID, 'article_thumb', true); ?><a href="<?php the_permalink() ?>" class="borderit"><img src="<?php echo $image; ?>" alt="<?php the_title(); ?>" style="margin-top:15px;margin-left:6px;margin-right:6px;margin-bottom:40px;" border="0" /></a></li>
  <?php endwhile;?>
Should you not want to link the thumbnail to the post on you weblog, but to Amazon, I gather you'd need to fill in another custom field, and use this information as the link.

There seem to be Amazon-plugins, and once you can get them to store their links as metadata in a custom field, it seems to me you're settled.
posted by ijsbrand at 6:42 AM on July 16, 2008


« Older Number of strip clubs in the U.S.?   |   Will trade cow for magic beans Newer »
This thread is closed to new comments.