Need help with TimThumb image path reference
-
I’m using the following code in an effort to generate a TimThumb cropped version of the featured image to appear at the top of the content area:
<div class="single-thumb"> <?php $thumbFeatured = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'featured-thumb'); ?> <img src="timthumb.php?src=<?php echo $thumbFeatured[0]; ?>&h=300&w=620" alt="<?php the_title(); ?>" width='620' height="300" /> </div>The original code used in the theme worked fine but forced the image to be a certain proportion which looked terrible on many images. So all I added was the
src="timthumb.php?in front of the previoussrcdeclaration, and of course adding the width and height references for TimThumb to apply. TimThumb.php is located at the document root level of the theme (the same as the single.php file that references this script), so it should work, but generates only a border in the given size with the alt tag.What am I doing wrong?
The topic ‘Need help with TimThumb image path reference’ is closed to new replies.