For 1.x only – use the new custom field mapping feature in version 2.0 to make this a lot easier.

StudioPress themes use Timthumb for thumbnail images, but Timthumb only works with locally hosted images. WP Zon Builder uses images hosted offsite by Amazon.

That means we need to remove the Timthumb code from the Studiopress themes and replace it with the code to display the image hosted by Amazon.

This example is for the StudioPress Lifestyle theme. It will translate over to any other StudioPress theme that uses Timthumb.

First, we have to find the Timthumb code. In the StudioPress Lifestyle theme the file to open is home.php, as it is the file that controls the display of the homepage.

Look for a block of code that looks like this

<?php if( get_post_meta($post->ID, “thumb“, true) ): ?>
<a href=”<?php the_permalink() ?>” rel=”bookmark”><img src=”<?php bloginfo(‘template_directory’); ?>/tools/timthumb.php?src=<?php echo get_post_meta($post->ID, “thumb”, $single = true); ?>&amp;h=<?php echo get_theme_mod(‘featured_top_left_thumb_height’); ?>&amp;w=<?php echo get_theme_mod(‘featured_top_left_thumb_width’); ?>&amp;zc=1” alt=”<?php the_title(); ?>” /></a>

The red portion is the Timthumb code. We want to remove that, and replace it with code to display the image from Amazon.

Change the red portion of the code to

<?php echo get_post_meta($post->ID, ‘amzn_SmallImageURL’, true); ?>

This will display the small product image from Amazon in place of a thumbnail generated by Timthumb.

The blue portion of the code is the name of the custom field that contains the thumbnail image URL. Change the blue portion of the code to

amzn_SmallImageURL

The end result should look like this

<?php if( get_post_meta($post->ID, “amzn_SmallImageURL”, true) ): ?>
<a href=”<?php the_permalink() ?>” rel=”bookmark”><img src=”
<?php echo get_post_meta($post->ID, ‘amzn_SmallImageURL’, true); ?>” alt=”<?php the_title(); ?>” /></a>

These instructions have been written specifically with the Lifestyle theme in mind, but these instructions apply to any theme using Timthumb.


Tags: , , ,