Editor's Choice

How To Add Amazon Products In A WordPress Blog

Simple Tips for Getting Items Listed on your Weblog

8 Comments
Join the Conversation
Amazon Widget Shortcodes - WordPress (highlighted) - David Borrink
Amazon Widget Shortcodes - WordPress (highlighted) - David Borrink
The potential frustrations of adding Amazon Merchandise to WordPress posts is eased by the use of the Amazon Widgets Shortcodes plug-in.

While WordPress is one of the most popular blogging platforms available, the ability to add certain types of features within a blog post provides some challenges. One problem usually involves adding javascript codes for features such as Amazon merchandise links.

Hey, Where did the Code Go?

The editing window in WordPress has a cleanup function which checks a post and makes sure it will render properly once it’s up and running. This has the effect of taking pasted-in codes, such as the javascript codes which Amazon provides for their product links, and re-writing them or stripping them from the pages.

This can be very frustrating for the user. Fortunately, there are plug-ins which not only protect the added code, but also add helpful functions for entering the code. These plug-ins can even make the entry of code more efficient.

What are Shortcodes?

Shortcodes are special code containers. They indicate that the real code is located elsewhere on WordPress. This allows the function of the code to be on the page without the risk of getting rewritten or stripped. Think of it as a special "shield" around the code.

Amazon Widgets Shortcode is Easy to Use

The Amazon Widgets Shortcode plugin takes care of this issue for Amazon products. After installing and activating the plug-in, enter the Amazon Tracking ID supplied, and an Amazon pop-down menu appears in the visual editing window above a post (see example below).

In a new or existing post, place an insertion point where the Amazon item should appear and choose the pop-down menu. Select the type of Amazon feature to be used, and enter the Amazon information in the dialog box that appears, or paste in the code in the separate tab. Click the Insert button, and a bar appears in the post.

The result is a placeholder box that indicates that the item will appear here in the post when viewed as an actual page. By default, the item will appear flush left, but can be changed by clicking inside the shortcode box (in the text) and choosing a different alignment option.

What About Product Previews?

If the pop-up product previews are desired, Amazon provides a code to add that function. This code needs to be placed in a template file, not in a post.

Place this code after the content and before the </body> tag, per Amazon’s instructions. Use a text editor to edit the footer.php template, placing the Amazon paste-in script above the </body> tag on that file.

The reason for placing it in the footer tag is so that no matter what type of page WordPress calls up, the footer is always used and guarantees the presence of this script in a page.

Using Amazon Codes in Sidebars

If items are to appear in sidebars, the use of WordPress widgets won’t require the use of the Amazon Widget Shortcodes plug-in.

In the Widgets panel on the Dashboard, add a new Text widget and paste the Amazon codes directly in the text field. A title is optional. Save the widget and update the changes. The items will appear on all pages with the sidebar.

David Borrink, David Borrink

David Borrink - David Borrink is a graphic designer who lives in Rockford, Michigan and is a partner with his wife in their design and writing business, ...

rss
Advertisement
Leave a comment

NOTE: Because you are not a Suite101 member, your comment will be moderated before it is viewable.
Submit
What is 3+2?

Comments

Jan 12, 2009 9:06 PM
Guest :
Does this work if you're not using Wordpress 2.0 at wordpress.org? Does it work on the free blogs at wordpress.com?
Suzanne
Jan 13, 2009 3:43 AM
David Borrink :
Suzanne,

The free blogs at WordPress.com are set up with the condtion that no advertising is alowed, so obviously that means this won't work with those.

This article provides the solution for WordPress.org blogs since they operate a certain way. Amazon affiiate programs can be used with most blogging programs such as TypePad, and others, as well. How their coding structure interacts with add-on scripts depends on the way their programs are coded.

Hope that helps.
David
Jul 28, 2010 10:37 AM
Guest :
I can't seem to get it to work with the wordpress component I have installed inside a joomla site. (Don't ask why...it was the web designer's idea). I uploaded the file into the correct spot, but it doesn't show up in wordpress plug-in...
Jul 28, 2010 12:28 PM
David Borrink :
If you're using a WordPress plug-in in a Joomla site, that would be like trying to use an Adobe plugin in Microsoft Word. They're two different programs from different developers, and it won't work.

WordPress plug-ins are created to work within the framework of WordPress, and not Joomla. You'd need to find a Joomla plug-in to allow Amazon items to be installed in a Joomla site.
Aug 4, 2010 3:58 AM
Guest :
This was a real help with this plugin.
I actually used the sidebar method the problem is I only want this particular Amazon widget on one Post and require different widgets on other Posts can this be done??
Bob
Aug 4, 2010 6:42 AM
David Borrink :
Bob,

Sidebars can be made custom for different posts, but it requires creating a different page template for each page. A page template calls up the various parts of a page structure, including the sidebar. You can create multiple sidebars in the dashboard, and set up custom widget configurations, then set up custom page templates to call up specific posts with specific sidebars. Refer to the WordPress codex, or ask some folks on the forums how you can set that up. With a little know-how, it can be done the way you want it.
Sep 5, 2010 4:22 AM
Guest :
very nice post, its very helpful to me..Thank you
Jan 7, 2011 2:47 PM
Guest :
Re: What About Product Previews?

So i can not do product reviews in edit post in wordpress? what is a template ? using wordpress 3.0
8 Comments
Advertisement
Advertisement