Automatically load thumbnail instead of full size image
-
Hi there,
I’m using a lot of images on my site and I’m trying to figure out one problem. I use a Custom Field Template plugin for adding images into certain places, this plugin uses attachment IDs and then I display those images in template like this:<?php if(get_post_meta($post->ID, "Image", true)) { ?><a href="<?php $thumb = get_post_meta($post->ID, 'Image', true); echo wp_get_attachment_url($thumb); ?>"><img src="<?php $thumb = get_post_meta($post->ID, 'Image', true); echo wp_get_attachment_url($thumb); ?>" width="132" height="88" /></a><?php } ?>
The problem is that I have to load a fullsize image for
<a>
element and then the SAME full size for thumbnail image which is actually much smaller (132×88 in my case) – this looks nasty and increases site’s traffic. Is there a way how to load the WP’s thumbnail which is automatically generated for each image?Thanks a lot…
- The topic ‘Automatically load thumbnail instead of full size image’ is closed to new replies.